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

Determine if page to include exists or not!  RSS feed

 
Simon Joseph Aquilina
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • 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
  • 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!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!