aspose file tools*
The moose likes JSP and the fly likes JSTL Code to fetch text field values dynamically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL Code to fetch text field values dynamically" Watch "JSTL Code to fetch text field values dynamically" New topic
Author

JSTL Code to fetch text field values dynamically

SachinJ Joshi
Greenhorn

Joined: Jun 05, 2008
Posts: 20
I am generating textfields dynamically using JSTL forEach.
Here is the code ..


If there are 4 values in underlyingTickersList A, B C, D and E ... I am getting those values correctly displayed in each text field.

However if I submit the form with all these value how can I get it in the bean? I guess I need to have dynamic id or name for each text field. How can generate it?

Note** I dont have Struts framework.. I am using request.getParameter to fetch the values and set into the bean variable.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61611
    
  67

id values have nothing to do with form submission at all; the name attribute is the parameter name used on submission.

Because you have four elements all with the same name, you can easily retrieve them as an array with request.getParameterValues().

Alternatively, you could give each element a dynamic name value if that makes more sense.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSTL Code to fetch text field values dynamically