• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Forward from Servlet to Action class?

 
A Harry
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to use a Servlet as part of my struts application.

is it possible to forward to a struts action class preserving the session object etc...?

Any sample code would be appreciated!

Many thanks

harry
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34965
378
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Harry,
Yes. How to do that depends on what you are trying to accomplish.

If you want to just call the action class and get the results in the request/session, you can instantiate it and call the execute() method.

If you want to call the action class and the JSP it forwards to, you can have the servlet forward to the path the action uses in the struts config file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic