This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question on <jsp:include>

 
subir rastogi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,
I was reading about <jsp:include> in JSP spec but did not quite understand how the page behaves for relave or absolute url's. For eg:

1. <jsp:include page="/dirA/test.jsp" > and the webapp context path is app1 then what should be the location of test.jsp.
Should it be /app1/dirA/test.jsp?

2. What should be location when of test.jsp <jsp:include page="dirA/test.jsp" >?

Thanks,
Subir

 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2343
90
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Subir,

1. <jsp:include page="/dirA/test.jsp" > and the webapp context path is app1 then what should be the location of test.jsp.
Should it be /app1/dirA/test.jsp?

Correct

2. What should be location when of test.jsp <jsp:include page="dirA/test.jsp" >?

This depends on the location of the including jsp:
If the including jsp has a location of:
/app1/dirA/including.jsp

it will look for the test.jsp in the following dir:
/app1/dirA/dirA/test.jsp

so relative to the location of the including jsp

Regards,
Frits
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic