struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vineet <vineet.vis...@gmail.com>
Subject unable to invoke Action class from my custom servlet
Date Mon, 29 Sep 2008 23:57:06 GMT

Hi I'm trying to invoke the Struts Action class through a Custom Servlet made
by me which is accepting request from outside world and based on a specific
parameter i need to redirect the request to appropriate action class. 

How do i invoke the action class from my servlet? 
I was trying to use RequestDispatcher() but not able to do so. 
service() of my servlet: 
        public void service(HttpServletRequest request, HttpServletResponse
response){ 
                System.out.println("This is the Custom Servlet"); 
                try{ 
                String attribs = request.getParameter("actionCategory"); 
                if(attribs.equalsIgnoreCase("rate") ||
attribs.equalsIgnoreCase("print")){ 
                        System.out.println("calling rd"); 
                        RequestDispatcher rd =
request.getRequestDispatcher("action"); 
                        System.out.println("after rd received::" +
rd.getClass().getName()); 
                        rd.forward(request, response); 
                } 
                }catch(IOException e){ 
                        e.printStackTrace(); 
                }catch(ServletException ex){ 
                        ex.printStackTrace(); 
                } 
        } 

Please suggest.
-- 
View this message in context: http://www.nabble.com/unable-to-invoke-Action-class-from-my-custom-servlet-tp19733970p19733970.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message