*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes jsp:include Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "jsp:include" Watch "jsp:include" New topic
Author

jsp:include

mallika shah
Ranch Hand

Joined: May 11, 2006
Posts: 164
Friends I have a problem in understanding this:-->

� A.jsp says <%@ include file=�dir/B.jsp�%> and dir/B.jsp says <%@ include
file=�C.jsp�%>. In this case the relative specification C.jsp resolves to dir/C.jsp.
� A.jsp says <jsp:include page=�dir/B.jsp�/> and dir/B.jsp says <jsp:include
page=�C.jsp� />. In this case the relative specification C.jsp resolves to dir/
C.jsp.
� A.jsp says <jsp:include page=�dir/B.jsp�/> and dir/B.jsp says <%@ include
file=�C.jsp� %>. In this case the relative specification C.jsp resolves to dir/C.jsp.
� A.jsp says <%@ include file=�dir/B.jsp�%> and dir/B.jsp says <jsp:include
page=�C.jsp�/>. In this case the relative specification C.jsp resolves to C.jsp.


This portion is from JSP Specs
i need some explanation as to how these are getting resolved ,..
like for the last one(4th) why it gets resolved to c.jsp and why not dir/C.jsp ??

Thanks,
mallika
Rajitha Arun
Ranch Hand

Joined: Aug 24, 2006
Posts: 43
Mallika Shah,

I was about to post the same question. I am also pretty confused. . Can somebody please help!

Thanks


Rajitha
SCJP, SCWCD
Rancy Chadha
Ranch Hand

Joined: Jul 12, 2006
Posts: 135
Hi Mallika and Rajee,

I think this article should help you understanding relative path interpretation in jsp:

How to interpret paths in JSP's inclusion

Thanks,
-Rancy


Thanks,<br />-Rancy
mallika shah
Ranch Hand

Joined: May 11, 2006
Posts: 164
thanks Ranchy, that was a good link..
Rajitha Arun
Ranch Hand

Joined: Aug 24, 2006
Posts: 43
Thank you so much, Rancy. That article really helped me to understand about the file and page attributes.
 
 
subject: jsp:include
 
Similar Threads
JSP: jsp:include & include diretive
include action vs. include directive
question of "include" in JSP spec 2.0
Need help: jsp: include relative path question!
Interpreting paths in jsp:include and include directive