• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

<jsp:include> Namespace

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Guys -

I am having a weird issue including a bit of JSP code in one of my pages.

If I use:


I get this when I try to access the including page:


However, when I just point the browser to http://localhost:8080/Project/jsp/content/navigation/links.jsp, I can access the page that should be included just fine.

I'm just trying to reuse some navigation that I have set up - does anyone know what the root search point for an include tag is, so I can set my links correctly?

Thanks for the help!
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The page URL must be relative to the context root, not the file system root.
 
Sam Gardner
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:The page URL must be relative to the context root, not the file system root.



Thanks - I figured that out via trial and error with different combinations just before you replied, but I'd like to get a better understanding of the process.

Is there a way to check or set the context root?

For instance, how would I create a link if one page is nested deeper than another in in the folder hierarchy?



Lets say, for some stupid reason, I had an application with its web content set up like so. How would I create a link to homepage.jsp from links.jsp, since they aren't in the same folder? Is there a way I can check the context root for links.jsp so I know the correct URL pattern to use?

Thanks for the help.
 
Bear Bibeault
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The context root is the folder which houses WEB-INF.
reply
    Bookmark Topic Watch Topic
  • New Topic