Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

<jsp:include> Namespace  RSS feed

 
Sam Gardner
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • 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!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The context root is the folder which houses WEB-INF.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!