• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp:forward

 
Jerret Halter
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay this is how my webpage is setup, there is a static webpage that contains a form and the form's actions is linked to a jsp page called home.jsp, then the home.jsp does a few random things and then at the very end does the following:
[code]
<jsp:forward page="/home.do"/>

How will I pass the values for parameters to this action that I am forwarding to?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A forward passes a request from the first resource to the second. As such, any request parameters available on the request are still available across the forward operation.

In other words, you don't need to "pass" anything; they're already there.
[ August 14, 2006: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way, what you are doing is considered a poor practice. If home.jsp isn't doing any view rendition it shouldn't be a JSP at all but a servlet.

If it is doing view rendition, then performing a forward after writing markup to the buffer is likely to cause an exception.
[ August 14, 2006: Message edited by: Bear Bibeault ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!