cancel
Showing results for 
Search instead for 
Did you mean: 

jsp:include

Former Member
0 Kudos

I want to include a JSP from another application. Is this possible?

I have one application called "include" and one application called "myapp". From the /myapp/index.jsp i'm trying to use the tag <jsp:include page="/include/myinclude.jsp" />. Nothing shows for the include and no errors are thrown.

Any help is appreciated.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

use <jsp:include page="myapp/include/myinclude.jsp" />.Hope this helps

please mark points for helpful answers

regards

rajeshkr

0 Kudos

Hi,

The include statement which you have written,

<jsp:include page="/include/myinclude.jsp" />. will not start looking for a web application with name "include" instead it starts looking in your own webapplication for the following path.

<You_application_root>\include\myinclude.jsp. which you will not be having and thus you dont see anything from that jsp.

If you want to include a JSP from another application first you need to get the Servlet Context of that application using the getContext("<server>\include") method in the Servletcontext class. Then after getting that context you can get ReqestDispatcher object from that context using the method getRequestDispatcher("/myinclude.jsp"). and then you can execute RequestDispatcher.include().

Hope this solves your problem

Please dont forget to award points

Regards,

Sesh