And i think that is the same to read these attributes or to use the corrispondent methods of HttpServletRequest.
/QB]
When calling RequestDispatcher.forward, we can specify new query parameters in a query
string or override the existing query parameters. The getQueryString method on the forward page returns this query string. the request.getAttribute("javax.servlet.forward.query_string") returns the original query parameters.
For example, if we have an original request like
http://localhost:8080/search/searchentry?key=abc Assume that we have a
servlet SearchEntry (url-pattern searchentry). In this servlet, we perform the search, and find out the relevant records, set these as an attribute for the request, and forward it as follows:
[CODE}
RequestDispatcher dispatcher = req.getRequestDispatcher(
"searchresult.jsp" + "?result=success");
dispatcher.forward(req, res);
[/CODE]
In this scenario, in searchresult.jsp,
will return result=success.
will return the original query string, ie key=abc.
- Gouri