Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding a new Parameter to request

 
Chhaya Dhanani
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
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..
Thanx
Chhaya
 
Kiran Kumar
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Al Green
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic