This week's book giveaway is in the Features new in Java 9 forum.
We're giving away four copies of Java 9 Revealed and have Kishori Sharan on-line!
See this thread for details.
Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp:include  RSS feed

 
mallika shah
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mallika Shah,

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

Thanks
 
Rancy Chadha
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
mallika shah
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Ranchy, that was a good link..
 
Rajitha Arun
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much, Rancy. That article really helped me to understand about the file and page attributes.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!