martsraits
martsraits

Reputation: 3015

Setting to display jsp:include error

I have following row in jsp:

<jsp:include page="file.jsp"/>

but the file.jsp doesn't exist.

In localhost development environment (using jetty) this error is ignored. jsp is displayed correctly displaying whitespace instead of file.jsp.

In test server (using jboss) following exception is thrown and the jsp is not displayed at all:

Caused by: javax.servlet.ServletException: File &quot;/WEB-INF/file.jsp&quot; not found
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:304) ~[jbossweb-7.0.17.Final-redhat-1.jar!/:?]
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253) ~[jbossweb-7.0.17.Final-redhat-1.jar!/:?]

I guess there's some setting which controls if exception is thrown or not? But where can I set this? I would like to see this exception in dev environment already.

Upvotes: 0

Views: 636

Answers (1)

Pankaj Sharma
Pankaj Sharma

Reputation: 1853

Instead of doing this, you can use :

<c:catch var ="catchException">
   <jsp:include page="file.jsp"/>
</c:catch>

Upvotes: 1

Related Questions