• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp param doubt?

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Is is true that with the jsp aram, they don�t replace existing parameters of the same name�they merely augment the list of values.

How does this happen?
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any help guys?
 
Rancy Chadha
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jothi,

Is is true that with the jsp: param, they don�t replace existing parameters of the same name�they merely augment the list of values.

Yes this is true. Here is what JSP spec say about this:
When doing jsp:include or jsp:forward, the included page or forwarded page will see the original request object, with the original parameters augmented with the new parameters, with new values taking precedence over existing values when applicable..
An example given in specs looks like this:
if the request has a parameter A=foo and a parameter A=bar is
specified for forward, the forwarded request shall have A=bar,foo. Note that the new param has precedence.

I took this from JSP 5.6 <jsp aram>.

I also have tested it, it works in the expected way. Hope this helps you.

Thanks,
-Rancy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic