aspose file tools*
The moose likes Struts and the fly likes is this possible.  forward to a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "is this possible.  forward to a servlet" Watch "is this possible.  forward to a servlet" New topic
Author

is this possible. forward to a servlet

Chris Pat
Ranch Hand

Joined: Aug 27, 2005
Posts: 156
Hello
Is it possible to use mapping.findforward("servlet") where servlet is as indicated? Why cant it be parameterized? I assume I can only pass params in the session. I know Actions turn into Servlets, but I have never seen any examples of a servlet being called this way. tia.
alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
findForward() takes a String that references a forward mapping in the struts-config.xml. so no, you can't just pass a servlet into there, but rather have the forward mapping mapped to the servlet. action > forward mapping > servlet.

btw, actions don't 'turn into servlet'. they are more like request handlers. struts has 1 servlet, ActionServlet, that is the primary controller of the web application.


-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
Chris Pat
Ranch Hand

Joined: Aug 27, 2005
Posts: 156
Thank you, however what would the syntax in the struts-config be? I cant get the path attribute correct.
Originally posted by alan do:
findForward() takes a String that references a forward mapping in the struts-config.xml. so no, you can't just pass a servlet into there, but rather have the forward mapping mapped to the servlet. action > forward mapping > servlet.

btw, actions don't 'turn into servlet'. they are more like request handlers. struts has 1 servlet, ActionServlet, that is the primary controller of the web application.
alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
where you define your forward inside the action-mapping or global forward, do <forward name="goToMyServlet" path="/myServlet"/>
 
Don't get me started about those stupid light bulbs.
 
subject: is this possible. forward to a servlet