tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio <antonio.petre...@gmail.com>
Subject Re: Throwing exception when including unexisting resource
Date Wed, 22 Oct 2008 13:05:25 GMT
2008/10/22 Tim Funk <funkman@joedog.org>:
>  if (null==servletContext.getResource(request.getServletPath())) {

Are you sure that it works? the "getServletPath" returns the path or
the name of the servlet.
Notice that anything could be included, from a JSP page to a called
servlet with parameters.
Anyway I think that the filter suggestion is good (thanks :-) ),
probably a HTTP request wrapper that checks if at least 1 byte is
written to the response could be useful.

> Then map the filter as needed (with any additional checks too)

Something like:
<filter-mapping>
        <filter-name>my_filter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>INCLUDE</dispatcher>
</filter-mapping>
?

Thanks
Antonio

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message