tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Heligon Sandra <sandra.heli...@nextream.fr>
Subject Exception management with Tomcat (URGENT)
Date Tue, 01 Oct 2002 08:35:27 GMT

> 	I defined a class MyServletContextListener where I use exceptions
> 	for example:
> 
> 	 public void contextInitialized(ServletContextEvent arg0) 
> 	 {
>       		s_context = arg0.getServletContext();
> 		try
> 		 {
>       		...
>       		}
> 		catch (ExInvalidUserName ex)
>       		{
> 		        ??
> 		}
>       		catch (ExInvalidPassword ex)
> 		{
> 		        ??
> 		}
>       		catch (ExInvalidSessionId ex)
>      		{
>         		        ??
> 		}
> 	}
> 
> 	In the web.xml I defined the following elements:
> 
> 	<error-page>
>  
> <exception-type>org.omg.CORBA.UserException.ExInvalidUserName
> </exception-type>
>     		<location>/errorPage.jsp</location>
>  	</error-page>
>   	<error-page>
>  
> <exception-type>org.omg.CORBA.UserException.ExInvalidPassword
> </exception-type>
>     		<location>/errorPage.jsp</location>
> 	</error-page>
>   	<error-page>
>  
> <exception-type>org.omg.CORBA.UserException.ExInvalidSessionId
> </exception-type>
>     		<location>/errorPage.jsp</location>
>   	</error-page>
> 
> 	The error message displayed in the errorPage.jsp file depends on the
> exception.
> 	How does it works ? Where do I specify the error message associated
> to each specific exception ?
> 	in the following lines ?
> 
> 	catch (ExInvalidUserName ex)
>       	{
> 		// Specify the error message to display ???	
> 	}
> 
> 	Has someone an exxample of a JSP page that allows to display
> exception error ?
> 
> 	Thanks a lot for you help,
> 	Sandra
> 
> 

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message