Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Including JSP Fragment at different levels

 
Ranch Hand
Posts: 153
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have a web application in Struts 2. It has common main menu and footer.. so I extracted the common stuff into JSP fragments and including them on different pages..

Not the issue is on of the JSP fragment is Main Menu at top bar. The urls i have given relative paths..its working fine with the first level urls.. like mydomain/home, mydomain/firstpage

but for the second level.. mydomain/inside/innerpage in this case the links on included jsp fragment are not working properly as I have given relative paths..


Is there any option or Do I have to go with absolute urls.. Its hard to maintain with absolute urls when I am testing in localhost..
 
Bala Tilak
Ranch Hand
Posts: 153
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

${pageContext.request.contextPath} gives the webApp context. So this solved the issue for both Development environment as well as production. Thank you.

Example:

 
What does a metric clock look like? I bet it is nothing like this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic