• 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

struts ActionServlet

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
struts framework usually uses a centrilized ActionServlet as a controller, it goes to different action class and forwards the results to different jsp pages. In Apache jarkata it briefly talks about it but has not too much good details/examples. Anybody has any examples URL ?
Thanks.
 
Ranch Hand
Posts: 416
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
some sample projects also have such servlet,such as petstore.........,you can download the petstore from sun's website,extract the source code.
maybe the MainServlet(i can't remember the name for sure) in petstore is the centralized servlet.
 
Saloon Keeper
Posts: 25838
184
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Technically, you can have more than one ActionServlet, but that would be an unusual case.
The standard Struts ActionServlet takes care of decoding incoming URLs, managing FormBeans and other generally useful tasks, after which it passes control to the Action class that it thinks should handle the functionality specific to the request.
You can do quite a bit using just the basic ActionServlet. This is why you may not find all that many examples of "using it" -- you simply refer to it in your web.xml file as the target for "*.do" requests and the ActionServlet gets its app-specific functionality from struts-config.xml.
For more ambitious projects you an also subclass ActionServlet - for example, if the standard ActionServlet's database pooling functions don't serve your needs, extend ActionServlet with methods that do.
 
zb cong
Ranch Hand
Posts: 416
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
otherwise,if you want to study the code,you can unzip the "struts.jar",and decompile the "ActionServlet.class"
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by zb cong:
otherwise,if you want to study the code,you can unzip the "struts.jar",and decompile the "ActionServlet.class"


or download the source code
Dave
reply
    Bookmark Topic Watch Topic
  • New Topic