I don't understand, how to catch exceptions in javax.servlet.http.HttpServlet.doGet.
This code works fine:

   public void doGet |(HttpServletRequest req, HttpServletResponse resp)
 {
   ...
   ...
   bla-bla-bla
   throw new ServletException ("my exception");
 }

I redirect exceptions to my error servlet page by web.xml:

   <error-page>
      <exception-type>java.lang.Exception</exception-type>
      <location>/error</location>
   </error-page>

but this code is not working in doGet (...). I don't get control to my error servlet:

   try
   {
java.nio.charset.Charset charset = java.nio.charset.Charset.forName ("unexisting charset");
   }
   catch (Exception e)
   {
       throw new ServletException ("Perkele: Charset error", e);
   }


I have exception list in tomcat container log file:

   java.nio.charset.UnsupportedCharsetException: unexisting exception
   ....
Exception Processing ErrorPage[exceptionType=java.lang.Exception, location=/error]
   java.lang.IllegalStateException

Question is, how can i control all exceptions in my servlet code?
Thanks!
|

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to