My apologies if this question's in the wrong area.
Essentially what I'm trying to do, is test if a request that's received by a Filter is going to be a 404.
I tried achieving this using the following code:
[code]
HttpServletRequest req = (HttpServletRequest)request;
if (!new File(context.getRealPath(req.getRequestURI().substring(request.getContextPath().length()))).exists())
{
// 404'd
}
[/code]
This works for [i]real[/i] files, but (obviously) doesn't pick up Servlet mappings. Is there either a generic function which takes a URI/URL and returns a (potential) error code, or some means I can use to determine the Servlet mappings, so I can test them myself?
Cheers,
- Tim
[Message sent by forum member 'tim_mead' (tim_mead)]
http://forums.java.net/jive/thread.jspa?messageID=231713