Pass parameters from servlet to jsp using the url
Hi i have a servlet that passes control to a jsp this way:
String url = "/test.jsp?code=1&msg=" + URLEncoder.encode("foo message");
RequestDispatcher rd = request.getRequestDispatcher(url);
Doing that way test.jsp doesn't receive msg parameter, and in explorer's navigation bar this url can be seen:
it seems that the RequestDispatcher turns & into &amp; and the url in the standard output (System.out) is
How can i avoid this behaviour?
Don't want to do so.
It implies that the query has to go back client and return to the server. I don't want't to do so
I want forward to work. I know other workarround is to put the parameters in the request scope
by using request.setAttribute, and reading them using request.getAttribute in test.jsp, but i have a large number of jsp pages and i don't want to do this chage.
Any other hint?
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center