not sure if struts handles exceptions thrown from RequestProcessor.

|-----Original Message-----
|From: [EMAIL PROTECTED]
|[mailto:[EMAIL PROTECTED]
|Sent: Friday, September 05, 2003 2:20 PM
|To: [EMAIL PROTECTED]
|Subject: Probelm with <global-exceptions> routing.
|
|
|I have written my own RequestProcessor class (MyRequestProcessor.java) by
|extending the STRUTS provided RequesrProcessor class. I have overridden the
|processPreprocess() method as below. Also I have defined the
|java.lang.NullPointerException in the <global-exceptions> of
|struts-config.xml as shown below. But still I am getting
|java.lang.NullPointerException instead of being routed to the index.jsp. Is
|there anything that I am missing. Any clues please.
|
|public boolean processPreprocess(HttpServletRequest request,
|HttpServletResponse response)
|{
|      try
|      {
|            System.out.println(" --------------- [MY REQUEST PROCESSOR
|CLASS EXCEPTION TRY ] ----------------- ");
|            NullPointerException n = new NullPointerException();
|            throw n;
|      }
|      catch(Error e)
|      {
|            System.out.println(" --------------- [MY REQUEST PROCESSOR
|CLASS EXCEPTION CATCH ] ----------------- ");
|      }
|}
|
|------------------------------------------------------------
|Made the below entries in struts-config.xml
|
|    <global-exceptions>
|        <exception key="message.example.simple" path="/index.jsp" type
|="java.lang.NullPointerException"/>
|    </global-exceptions>
|
|    <controller processorClass="examples.MyRequestProcessor"/>
|
|------------------------------------------------------------
|
|The stack trace that I am getting on the screen:
|java.lang.NullPointerException
|             at
|examples.MyRequestProcessor.processPreprocess(MyRequestProcessor.java:36)
|             at
|org.apache.struts.action.RequestProcessor.process(RequestProcessor.
|java:237)
|
|             at
|org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
|             at
|org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:506)
|             at
|javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
|             at
|javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
|             at
|org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ap
|plicationFilterChain.java:247)
|
|             at
|org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicatio
|nFilterChain.java:193)
|
|             at
|org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrappe
|rValve.java:243)
|
|             at
|org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeli
|ne.java:566)
|
|             at
|org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
|             at
|org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
|             at
|org.apache.catalina.core.StandardContextValve.invoke(StandardContex
|tValve.java:190
|
|Regards
|Sreekant G
|
|
|


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

Reply via email to