On 25/09/2014 23:36, Konstantin Kolinko wrote:
> Hi!
> 
> Regarding exception generated by JspServlet when it is invoked via
> RequestDispatcer.include() and the requested JSP page does not exist.
> 
> As seen from the stacktrace in bug 57019 [1], it generates a
> ServletException. The relevant place in the code is
> JspServlet.handleMissingResource().
> 
> In chapter 9.3 "The Include Method" of Servlet Specification 3.1 there
> is the following requirement:
> 
> [quote]
> If the default servlet is the target of a RequestDispatch.include()
> and the requested
> resource does not exist, then the default servlet MUST throw
> FileNotFoundException.
> [/quote]
> 
> Would it make sense for JspServlet to throw a FileNotFoundException as
> well, instead of a ServletException?

I'm leaning towards not. The JSP specification in the Javadoc for
javax.servlet.jsp.HttpJspPage._jspService indicates that
ServletException should be used for problems processing the page and
IOException for problems writing the response.

Not being able to find an included file seems more like a problem
processing the page to me so ServletException is appropriate.

Mark


> 
> 
> [1] https://issues.apache.org/bugzilla/show_bug.cgi?id=57019#c0
> 
> Best regards,
> Konstantin Kolinko
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to