• Post Reply Bookmark Topic Watch Topic
  • New Topic

response.sendRedirect() Parameters  RSS feed

 
Shailesh Pillai
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I m using response.sendRedirect() in my JSP page which redirects me to another jsp page. But i also want some parameters to be passed along with it. Ya, the syntax of response.sendRedirect() supports parameters to be passed, but parameters are passed by specifying values explicitly i.e. hard-coded. For e.g. :

String theURL = "http://xyz.com/mypage.jsp?"+ "Parameter1=value1&Parameter2=value2";


I want to use values in the variables (in my JSP Page) as parameters. Can u suggest me the right syntax for "passing variables as parameters with response.sendRedirect()".
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use the JSTL redirect tag.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!