Extending Struts ActionServlet and RequestProcessor -
can tell me scenario in should extend actionservlet
class , requestprocessor
? have read in struts documentation can done, don't understand in situation.
regards,
aashutosh
the actionservlet , requestdispatcher main players in struts framework. actionservlet treats requests made struts application , delegates "heavy lifting stuff" of handling request requestprocessor object.
in struts application have operations performed creating action classes, each action taking care of own different stuff. though wish perform common operations actions logging or security , don't want them performed inside each action class you? mean lot of code duplication, have place common behavior somewhere above individual actions.
the actionservlet , requestprocessors make candidates sort of stuff. sure, write filter actionservlet , requestprocessors contain code related framework there not point in starting scratch when can reuse exists , extend it.
the subject of extension typically requestprocessor (more actionservlet) read the javadoc of requestprocessor , see there lot of useful methods extend , add hooks important stages of execution.
to give concrete example: tiles plugin makes use of extension of requestprocessor.
Comments
Post a Comment