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

Request dispatcher

 
Yogesh Hingmire
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,

If i do a rd.forward(req,res) from a servlet to a jsp and then again in the servlet after the forward if i write to the output or do any thing
will that code be executed any time?

RequestDispatcher rd = request.getRequestDispatcher("/jsp/index.jsp");
rd.forward(request, response);
// do something


Will the code in the servlet after forward() execute ? I feel no, so even if i do out.println("hello") it wont throw an Illegalstate exception

Please let me know on this



Thank you
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://faq.javaranch.com/view?IllegalStateException
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic