Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   problems with get status code from servlet response (http://www.velocityreviews.com/forums/t144651-problems-with-get-status-code-from-servlet-response.html)

Michelle X. 07-05-2005 10:41 PM

problems with get status code from servlet response
 
I am trying to create a filter that logs any request for a invalid url.
So in my filter, I need to exam any servlet response to see if it
contains status error code 404. But I couldn't find any methods to
get the content of the response such as status line, seem like
HttpServletResponse class only provides ways to change response instead
of looking into the response.


William Brogden 07-06-2005 03:04 PM

Re: problems with get status code from servlet response
 
On 5 Jul 2005 15:41:01 -0700, Michelle X. <theintangible1@hotmail.com>
wrote:

> I am trying to create a filter that logs any request for a invalid url.
> So in my filter, I need to exam any servlet response to see if it
> contains status error code 404. But I couldn't find any methods to
> get the content of the response such as status line, seem like
> HttpServletResponse class only provides ways to change response instead
> of looking into the response.
>


I suppose you could create an extension of HttpServletResponseWrapper
that overrides sendError methods and lets the filter see what has been set.
Bill



Andrea Desole 07-06-2005 03:48 PM

Re: problems with get status code from servlet response
 


Michelle X. wrote:
> I am trying to create a filter that logs any request for a invalid url.


Wouldn't it be a better solution to log everything in the 404 page? You
can do that with the error-page element in the web.xml


All times are GMT. The time now is 09:38 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.