• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

question on <jsp:include>

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Creator of Enthuware JWS+ V6
Posts: 3398
312
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic