wood burning stoves 2.0*
The moose likes Struts and the fly likes override actionservlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "override actionservlet" Watch "override actionservlet" New topic
Author

override actionservlet

A Babu
Ranch Hand

Joined: Nov 28, 2005
Posts: 114
hi all,
can we override the actionservlet.

that mean i am not interested to use the funtionality of the actionservlet which is come with struts framework.

i want to write my own functionality what actionservlet actually do.

is it possible..

cheers,
babu.


Thanks,
www.Admakr.in
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The authors of Struts anticipated that users might want to do things a little differently, so they wrote the components (ActionServlet, RequestProcessor, etc.) with extensibility in mind. So, the answer is yes, you can override the ActionServlet.

To do so, just write a class that extends ActionServlet and then put your class as the <servlet-class> in the action servlet definition in the web.xml file.

Maybe it's just a language thing, but the way you worded your question, it sounded like you don't want to use any of the existing functionality of the action servlet. If that's the case, why use Struts at all? Just write your own framework. If you just want to modify a few minor things about the way Struts handles things, then you're on the right track by extending ActionServlet.


Merrill
Consultant, Sima Solutions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: override actionservlet
 
Similar Threads
overriding ActionServlet in struts
how to override action servlet in struts
ActionServlet destroy()
struts servlet init
how to overide the service method of action servlet