• 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
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!