You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Heligon Sandra <sa...@nextream.fr> on 2002/10/01 10:02:03 UTC

Exception management with Tomcat (URGENT)

	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 ???	
	}

	Thanks a lot for you help,
	Sandra



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>