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

Capture exception generated by <c:import url  RSS feed

 
Mat Anthony
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I currently call a servlet from within my jsp using a jstl tag lib as follows:-

<c:import url="${servletLocation}/someLoggerServlet">
<c:param name='fullDebug' value="${turnOnFullDebug}" />
</c:import>

If the deployed application does not contain the servlet then the followig error appears on
my screen:-

500 Internal Server Error
javax.servlet.jsp.JspException: Problem accessing the absolute URL
java.io.FileNotFoundException:

How can I captutre this exception so that I can display a user friendly message instead

Mat
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would the deployed app not contain the servlet? Since it's all part of the same web app, why is this even a concern? Don't you you know what you've deployed?
 
Mat Anthony
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,
the jsp can be used to point to serval deployed applications on different machines. Not all the the deployed applications
have servlets (i.e. different versions). Hence I need to be able to capture the exception that seems to thrown if no servlet is present
and display a user friendly message to the user.

Mat
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It still sounds as if this is something that should be handled at build time. Waiting until run-time seems a poor way of dealing with this.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!