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?
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL