File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes displaying data from arrays with html:text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "displaying data from arrays with html:text" Watch "displaying data from arrays with html:text" New topic
Author

displaying data from arrays with html:text

Marek Lapin
Greenhorn

Joined: Sep 19, 2004
Posts: 15
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

Joined: Jan 27, 2004
Posts: 71
Try this:



--Nimchi
Marek Lapin
Greenhorn

Joined: Sep 19, 2004
Posts: 15
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

Joined: Aug 18, 2004
Posts: 157
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

Joined: Sep 19, 2004
Posts: 15
Thanks a lot !!

I omited somehow this part of struts
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: displaying data from arrays with html:text