• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

is this possible. forward to a servlet

 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Chris Pat
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
where you define your forward inside the action-mapping or global forward, do <forward name="goToMyServlet" path="/myServlet"/>
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic