Struts is not only a powerful framework but also very extensible. You can extend Struts in one or more of the
following ways:
PlugIn: Define your own PlugIn class if you want to execute some init() and destroy() methods during the
application startup and shutdown respectively. Some services like loading configuration files, initialising
applications like logging, auditing, etc can be carried out in the init() method.
RequestProcessor: You can create your own RequestProcessor by extending the Struts RequestProcessor.
For example you can override the processRoles(req, res, mapping) in your extended class if you want to query
the LDAP server for the security authorization etc.
ActionServlet: You can extend the ActionServlet class if you want to execute your business logic at the
application startup or shutdown or during individual request processing. You should take this approach only
when the above mentioned approaches are not feasible.
浙公网安备 33010602011771号