aspose file tools*
The moose likes Struts and the fly likes Call a servlet(one that extends HttpServlet) from any of the action classes ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Call a servlet(one that extends HttpServlet) from any of the action classes ?" Watch "Call a servlet(one that extends HttpServlet) from any of the action classes ?" New topic
Author

Call a servlet(one that extends HttpServlet) from any of the action classes ?

san geetha
Ranch Hand

Joined: Sep 07, 2004
Posts: 44
The scenario is, i have a class A that extends Action class.
I want to redirect the control to servlet, where by using ServletOutputStream i wud display some data in Excel format.
Iam aware that in struts, after executing the excute() method in the Action Class..the controller servlet needs to forward the control to anyother jsp or action class.
So how do i go about in my scenario.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
You can also make your Action class' execute() method return a new ActionForward("/servlets/MyExcelGeneratorServlet")


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
san geetha
Ranch Hand

Joined: Sep 07, 2004
Posts: 44
Ok, let me try and get back if i face some other issues.
Thanks a lot
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Call a servlet(one that extends HttpServlet) from any of the action classes ?