Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Include Directive

Status
Not open for further replies.

SON1

Programmer
Nov 21, 2004
51
CY
Does anyone knows if i can use an include directive for a servlet and not another JSP ?

thanx
 
Get the RequestDispatcher object from the servlet, and then call the include method :

Code:
RequestDispatcher rd = getServletContext().getRequestDispatcher("/yourPage.html");
rd.include(request, response);

--------------------------------------------------
Free Database Connection Pooling Software
 
hmmm, is that for putting servlets into jsps or for putting jsps into servlets ? I want the 1st one
 
Either ... a JSP is basically compiled into a servlet anyway ...

--------------------------------------------------
Free Database Connection Pooling Software
 
so in my JSP i put :

RequestDispatcher rd = getServletContext().getRequestDispatcher("/MenuServlet");
rd.include(request, response);


where i want it to be displayed ?

 
Well it might work, and it might not, I've never tried to inlcude a servlet from a JSP ... it doesn't really seem to make sense to me, but there you go.
You may want to look at this aswell :
--------------------------------------------------
Free Database Connection Pooling Software
 
thanxc a lot for you help :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top