Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can a servlet include jsp files?

 
Ryan Yeap
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way? for servlets to include external jsp files to compile and display them?
thanks
 
Alejandro Villalobos
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, including jsp files in a servlet like in a jsp is possible, you have to use the following sentences:
request.getRequestDispatcher("/myJsp.jsp").include(request,response);
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic