Modifying parameters in HttpServletRequest

J

Jun

Is it possible to modify parameter received from client
before forwarding to another object?

If no, how people get around when they when to
change parameters before forwarding?

I can not use attributes since the receiver is expecting
parameters instead of attributes...

thanks
 
R

Ryan Stewart

Jun said:
Is it possible to modify parameter received from client
before forwarding to another object?

If no, how people get around when they when to
change parameters before forwarding?

I can not use attributes since the receiver is expecting
parameters instead of attributes...

thanks
One possibility that I don't care for much would be to have a servlet/JSP to
get the parameters and change them to whatever you want, then redirect to
the new page passing the new parameters in the querystring
(blah.com/somePage.jsp?id=123&mode=blah).

If you're using JSP, a different method that I would prefer, though it still
seems inelegant, is to get the parameters and modify them, then stick them
in hidden fields within a form with method=post and submit it automatically.
It basically accomplishes the same thing but hides all the data.

That's my two cents worth, but I have limited knowledge in this area.
 
J

Jun

Ryan Stewart said:
One possibility that I don't care for much would be to have a servlet/JSP to
get the parameters and change them to whatever you want, then redirect to
the new page passing the new parameters in the querystring
(blah.com/somePage.jsp?id=123&mode=blah).

If you're using JSP, a different method that I would prefer, though it still
seems inelegant, is to get the parameters and modify them, then stick them
in hidden fields within a form with method=post and submit it automatically.
It basically accomplishes the same thing but hides all the data.

That's my two cents worth, but I have limited knowledge in this area.

My question is not about "redirect" but forwarding...
 
R

Ryan Stewart

Jun said:
"Ryan Stewart" <[email protected]> wrote in message

My question is not about "redirect" but forwarding...

It's a semantic difference, isn't it? Besides, neither a redirect nor a
forward can pass parameters except as a query string that I'm aware of. What
are you using (servlets, JSPs?) and what exactly are you trying to do?
 
A

Alex

There is only on way, you have to make wrapper Object of
"HTTPServletRequest" an at this Object you can change the Values!

Alex
 
J

Jun

That was what I did and I also need to sub class and have a super
for all my Actions.

thanks all!
 
J

Jun

That was what I did and I also need to sub class of ServletAction and have a super
for all my Actions.

thanks all!
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top