wood burning stoves 2.0*
The moose likes Struts and the fly likes When and how to customize the ActionServlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "When and how to customize the ActionServlet " Watch "When and how to customize the ActionServlet " New topic
Author

When and how to customize the ActionServlet

Vijay jai Singh
Greenhorn

Joined: Jan 07, 2009
Posts: 26
Hi,

In which situation we should consider the customization of ActionServlet and how we will customize the ActionServlet.

Vijay
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Almost never. 99.9% of the time it's not what you want to do.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

When:
When you wants some common processing for all request, like session check, any other message, etc..

How:
By extending org.apache.struts.action.ActionServlet. Make sure that you put the reference of this customized action servlet into DD.

[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

That kind of behavior should go into a custom request processor, almost all the time.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Yes, that's more correct. ActionSerlvet delegates the request processing logic to RequestProcessor. So there is nothing you "really" need to extend it ;)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When and how to customize the ActionServlet
 
Similar Threads
Servletcontext object to actionservlet in struts
overriding ActionServlet in struts
how to override action servlet in struts
Best practice
can we extend ActionServlet