| Author |
question on <jsp:include>
|
subir rastogi
Greenhorn
Joined: Apr 11, 2006
Posts: 18
|
|
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
Rancher
Joined: Apr 07, 2010
Posts: 1041
|
|
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
|
 |
 |
|
|
subject: question on <jsp:include>
|
|
|