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-java-servlet-tp19725620p19725620.html
Sent from the Struts - Dev mailing list archive at Nabble.com.

Reply via email to