Hi,
it is possible to add new parameters to request object when using jsp pages
<jsp:forward ...
<jsp:param ..
but there is no way that I know to do the same thing in servets while forwarding the request to another page. Should not there be a way of doing this?
-
How to add new parameters to request object (2 messages)
- Posted by: Burak AKSOY
- Posted on: July 22 2003 02:02 EDT
Threaded Messages (2)
- How to add new parameters to request object by Paul Strack on July 22 2003 12:30 EDT
- How to add new parameters to request object by Burak AKSOY on July 23 2003 05:02 EDT
-
How to add new parameters to request object[ Go to top ]
- Posted by: Paul Strack
- Posted on: July 22 2003 12:30 EDT
- in response to Burak AKSOY
There is no way to add request parameters to a HttpServletRequest object. This allows the servlet engines to optimize how they handle request parameters.
My suggestions are:
1) Pass data in the forward operation in other ways, such as request.setAttribute(). You can even use alternate logic to check both request parameters and request attributes:
<%
String data = request.getParameter("data");
if (data == null) {
data = request.getAttribute("data");
}
2) If this really won't work, you can use a Servlet 2.3 HttpServletRequestWrapper (or some custom variation on this if you are using Servet 2.2), but this is probably more trouble than it is worth. -
How to add new parameters to request object[ Go to top ]
- Posted by: Burak AKSOY
- Posted on: July 23 2003 05:02 EDT
- in response to Paul Strack
thanks a lot for your care,
using a wrapper we solved the problem but I believe that current servlet spesifications lacks such functionality and should be added to HttpServletRequest interface for the comming spesification releases.