File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

displaying data from arrays with html:text

 
Marek Lapin
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have an array of strings as property in my ActionForm.
I want to display its content into text boxes (each string into its text box) without using struts nested extensions.

How to do it ?

if i use logic:iterate to go trough the collection (array) then i have to specify a bean (html:logic id="beanName") that will repesent the current object of the collection i am iterating
but the html:text uses a property of a bean. the current bean is just a plain java Strign object.. how can i get its value to the html:text ?

example


in JSP..
 
Nimchi Yung
Ranch Hand
Posts: 71
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this:



--Nimchi
 
Marek Lapin
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for advice

BUT i preffer the 'pure' approach so i need to use only Struts

well, mixing struts and jsp tags.. eah, ugly
 
Sheldon Fernandes
Ranch Hand
Posts: 157
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add these methods to your form bean.


In your jsp, try this.


See Indexed Properties, Mapped Properties, and Indexed Tags

Sheldon Fernandes
[ October 10, 2004: Message edited by: Sheldon Fernandes ]
 
Marek Lapin
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot !!

I omited somehow this part of struts
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic