on 10-05-2005 10:24 PM
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.
HI
GOOD
GO THROUGH THIS LINKS
http://java.sun.com/developer/technicalArticles/xml/WebAppDev/
http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/Servlet-Tutorial-JSP.html
http://www.lc.leidenuniv.nl/awcourse/oracle/java.920/a96657/basics.htm
http://www.cs.unc.edu/Courses/jbs/lessons/java/java_jsp/jsp_syntax.html
http://www-128.ibm.com/developerworks/java/library/j-jsp04293.html
THANKS
MRUTYUN
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
use <jsp:include page="myapp/include/myinclude.jsp" />.Hope this helps
please mark points for helpful answers
regards
rajeshkr
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.