You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Java Pro <ja...@gmail.com> on 2006/02/16 18:51:34 UTC

[Fwd: How can we capture all errors without defining it]

Is there anyone who can help me with this query?


-------- Original Message --------
Subject: 	How can we capture all errors without defining it
Date: 	Wed, 15 Feb 2006 12:30:04 +0530
From: 	Java Pro <ja...@gmail.com>
To: 	users@tomcat.apache.org



Hi,

I would like to know, if we can capture all the errors to a servlet 
without defining the list of errors in web.xml as follows..

generally, we can capture an error like this:
	<error-page>
		<error-code>400</error-code>
		<location>/errorHandler</location>
	</error-page>
	<error-page>
		<error-code>401</error-code>
	.
	.
	.

is this possible? (see below)
	<error-page>
		<error-code>AllErrors</error-code>
		<location>/errorHandler</location>
	</error-page>
	
or is there any other mechanism?

Thanks.






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


Re: [Fwd: How can we capture all errors without defining it]

Posted by Len Popp <le...@gmail.com>.
You need a separate error-page declaration for each error code,
according to the servlet spec. The set of HTTP status codes is
limited, so after a couple minutes of copy & paste you'll be done with
it.

On 2/16/06, Java Pro <ja...@gmail.com> wrote:
> Is there anyone who can help me with this query?
>
>
> -------- Original Message --------
> Subject:        How can we capture all errors without defining it
> Date:   Wed, 15 Feb 2006 12:30:04 +0530
> From:   Java Pro <ja...@gmail.com>
> To:     users@tomcat.apache.org
>
>
>
> Hi,
>
> I would like to know, if we can capture all the errors to a servlet
> without defining the list of errors in web.xml as follows..
>
> generally, we can capture an error like this:
>         <error-page>
>                 <error-code>400</error-code>
>                 <location>/errorHandler</location>
>         </error-page>
>         <error-page>
>                 <error-code>401</error-code>
>         .
>         .
>         .
>
> is this possible? (see below)
>         <error-page>
>                 <error-code>AllErrors</error-code>
>                 <location>/errorHandler</location>
>         </error-page>
>
> or is there any other mechanism?
>
> Thanks.
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


--
Len

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


Re: [Fwd: How can we capture all errors without defining it]

Posted by Ramin Farhanian <aq...@yahoo.com>.
Throws advice in AOP concept is another mechanism. Go for AspectJ or Aspect Werkz, Spring AOP or ....They all support the lovely Aspect Oriented Concept.
   
  Regards,
  Ramin

Java Pro <ja...@gmail.com> wrote:
  Is there anyone who can help me with this query?


-------- Original Message --------
Subject: How can we capture all errors without defining it
Date: Wed, 15 Feb 2006 12:30:04 +0530
From: Java Pro 
To: users@tomcat.apache.org



Hi,

I would like to know, if we can capture all the errors to a servlet 
without defining the list of errors in web.xml as follows..

generally, we can capture an error like this:

400
/errorHandler


401
.
.
.

is this possible? (see below)

AllErrors
/errorHandler


or is there any other mechanism?

Thanks.






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