Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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
Pie
Posts: 3930
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 ).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic