aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes question on <jsp:include> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "question on <jsp:include> " Watch "question on <jsp:include> " New topic
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
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1660
    
  25

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question on <jsp:include>