Forums Register Login
jstl tag
Within a for each tag, i have a text box created dynamically till the end of for each tag,Now i want to get the values of the text box from jsp to servlet . but i would like to know how to request.getparameter().
I tried puting the
<c:forEach var="row" tems="${sessionScope.listOfBeans}">
type="text" name="license"+"${row}" value=" ${row.team_ph}"

but the row value i random and would not be able to get the exact value in servlet ie request.getparameter(???).
Any alternative for this... a sample example would be appreciated

How about using request.getParameterNames() first to get an Enumeration of all the parameter names? Then use those names with request.getParameter().
The JSTL specification is a great resource.

The JspFaq has a link to the SpecificationUrls.

Not sure what version of JSTL you are using, but I took a quick look at the JSTL 1.1 specification and found this:

It is also possible to access HTTP request parameters
via the implicit objects param and paramValues. param is a Map object where
param["foo"] returns the first string value associated with request parameter foo,
while paramValues["foo"] returns an array of all string values associated with that request parameter.
The code below displays all request parameters along with all their associated

you should really download the specification. In case I made an error re-formatting the information from the spec, please take a look at the actual example code in the spec.
[ June 07, 2008: Message edited by: Carol Enderlin ]
Hi Kittu,

You need not change the name of the text box dynamically, you can have it as static like,

In servlet if there are multiple values for a request parameter (in this case 'license'), it will be returned to you as an array. Hence you can get it like,

Hope this helps.
My, my, aren't you a big fella. Here, have a tiny ad:
Rocket Oven Kickstarter - from the trailboss

This thread has been viewed 1054 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jul 16, 2018 01:00:19.