using param to access parameters with the same name

M

Murray

homecurr said:
Suppose here is the link to my jsp
http://www.mydomain.com/webapp/app/page1.jsp?id=1&id=2&id=3. How can I
access the parameter in page1.jsp using jstl? Looks like ${param.id}
only retrieve 1.

${paramValues.id} will return the String[] containing all values of id
Another question:

If in page1.jsp, I have

<% String[] ids = request.getParameterValues("id") %>

How can I access "ids" from jstl tags following?

You need to put ids onto the pageContext (or request or session or
application -- wherever you need it, but usually page context will do)

pageContext.setAttribute("ids", ids);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top