[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-dev
Subject:    Re: Unable to invoke Action class from My java servlet
From:       Dave Newton <newton.dave () yahoo ! com>
Date:       2008-09-29 15:17:09
Message-ID: 361003.58164.qm () web56707 ! mail ! re3 ! yahoo ! com
[Download RAW message or body]

Please ask this question on the struts-user mailing list; the dev list is for the development of Struts itself.

Thanks,
Dave

--- On Mon, 9/29/08, Vineet wrote:
> 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.

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic