• Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt in <jsp:forward />

 
Sai Surya
Ranch Hand
Posts: 463
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

HFSJ mentions that if we commit the response before the forward the client will be sent whatever was flushed and the forward won't happen.
In this case, how to make a successful forward?

 
Vijitha Kumara
Bartender
Posts: 3953
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should either forward the request to some other component or response yourself. If you try to forward after commit the response is already gone, so the forward will have no effect on the response (though you'll get an fat IllegalStateException ).
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!