• 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

Determine if page to include exists or not!

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

At the moment the page I am working on is using an the jsp:include tag to include another jsp page which is part of the website. However I want to change this so that it includes this page only if it exists, otherwise it will include another page.

Does anyone know how I can do this?

What I tried is use the request.getRealPath(...) - however I found out that this is depreciated and that its use is discouraged because it returns null when used from a website packages as a WAR file!

Regards,
Sim085
 
Simon Joseph Aquilina
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry to bring this up again. My current solution works fine in this way - however I still am not sure if this is a good practice? or if maybe there is a better way how I can achieve the same thing!
reply
    Bookmark Topic Watch Topic
  • New Topic