In struts what happens if made any changes in actionservlet?

Questions by sadashivarao   answers by sadashivarao

Showing Answers 1 - 4 of 4 Answers

Kamal Lochan

  • May 20th, 2006
 

The ActionServlet plays the role of controller wich is responsible for handling the request and selecting the correct Application Module and storing  ApplicationConfig and MessageResource bundle in the request object.

If we modify the ActionServlet the Controller may or may not work what happens that depends on your modification, You have not specify whether you want to create your own custom ActionServlet by extending ActionServlet and overriding the methods in it or what exactly you want to modify.

Kamal Lochan, UBIQUE, Kolkata

  Was this answer useful?  Yes

srini

  • May 3rd, 2007
 

Offcourse you can make changes to actionservlet by extending it and override the particular method or funcationality which is not meeting your problem requirements.

Check with RequestProcess interface and see by having you own request process class implementation if you can solve your problem go with it otherwise follow below apporach.

Extended base action servlet to override particular method or funcationality, make sure you call the base method  at the begining of overiding method and then do implement your solution in the extended action servlet.
1. when you call to the base method of actionservlet it does all by default what it suppose to  as per the struts framework implementation.
2. then you do implement your solution.

In web.xml file instead of specifiying the actionservlet specify your extended actions ervlet path.

Note: maximum cases you do not have to extended actionservlet unless it is not fullfilling your solution needs.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions