• Post Reply Bookmark Topic Watch Topic
  • New Topic

contextPath won't work in JSP  RSS feed

 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<jsp:include page="${pageContext.request.contextPath}/WEB-INF/includes/nocache.jsp"/>

I tried it several times... It doesn't work... But when I do

<jsp:include page="WEB-INF/includes/nocache.jsp"/>

it does...
[ August 21, 2006: Message edited by: Timothy Sam ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Timothy, you've been around the Ranch long enough to know to use better subjects than this.

Also, be please more explicit about what "doesn't work" means in the future.

In this case, I can tell you that when performing any server-side reference to another resource, the context path is not necessary. The container knows what the context path is, so you don't need to specify it.

Only with client-side references (urls, images, stylesheets, script files, and so on) is the context path required.
[ August 21, 2006: Message edited by: Bear Bibeault ]
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Uhmmm... Thanks, I'll just change the subject anyway...
[ August 21, 2006: Message edited by: Timothy Sam ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.

Now, did you understand the answer?
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, thank you very much. Sorry about the title I won't do it again. Things should be a lot easier for me then, thank you.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Timothy Sam:
Sorry about the title I won't do it again.


No need to apologize. The guidelines are there to help you get answers to your questions.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!