wood burning stoves 2.0*
The moose likes Servlets and the fly likes Adding a new Parameter to request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Adding a new Parameter to request" Watch "Adding a new Parameter to request" New topic

Adding a new Parameter to request

Chhaya Dhanani
Ranch Hand

Joined: Apr 11, 2001
Posts: 70
i am unable to find a decent approach for this problem.
i want to add a new paramter to my request and pass it to a class.. not a servlet.
how do i do it?
Please help me sought this problem immediately..
Kiran Kumar
Ranch Hand

Joined: May 18, 2001
Posts: 107
a class cannot get the HttpRequest object directly. it has to be passed from the servlet. so if u want to send some object to the class use the request.setAttribute() and then pass it to the class

Thanks<br /> <br />Kiran <br /> <br />SCEA, SCJP 1.4,<br /> <br />"First they ignore u, then they laugh at u, then they fight u, <br />then u will win<br /> <br />Mahatma Gandhi"
Al Green

Joined: Feb 09, 2002
Posts: 10
In Servlet2.2 the only way to mutate the HttpRequest is to use the setAttribute method.
However, in Servlet2.3, you can use the HttpServletRequestWrapper (I believe thats the correct class name) to wrap the request which allows you to basically mutate (lie) about the http request.
wood burning stoves
subject: Adding a new Parameter to request
Similar Threads
response.setHeader not working
Calling another servlet from the current servlet?
Multiple rows inserted coz of page refresh
Passing Document from servlet to JSP see code
How to stop data insertion on page refresh