This can be done in a Filter. Horribly pseudo coded as:
doFilter(...) { if (null==servletContext.getResource(request.getServletPath())) { throw new ServletException("No file"); } chain.doFilter(...); } Then map the filter as needed (with any additional checks too) -Tim Antonio wrote:
Hi all, I am a Tiles developer and I am struggling to resolve a problem in Tiles, that is reflected from a "gap" in the servlet specifications: https://issues.apache.org/struts/browse/TILES-320 What I want to do is to throw an exception whenever an included (through the use of RequestDispatcher.include and PageContext.include) resource is missing. The problem is that RequestDispatcher.include and PageContext.include do not throw anything if a resource is missing, they simple "go on" rendering the page. The API specification does not say anything about it: http://java.sun.com/javaee/5/docs/api/javax/servlet/RequestDispatcher.html#include(javax.servlet.ServletRequest,%20javax.servlet.ServletResponse) http://java.sun.com/javaee/5/docs/api/javax/servlet/jsp/PageContext.html#include(java.lang.String)
--------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]