How can Struts check for a set of global conditions before processing an action?
Location: http://www.jguru.com/faq/view.jsp?EID=471959 Created: Aug 8, 2001 Author: Ted Husted (http://www.jguru.com/guru/viewbio.jsp?EID=462042) This often comes up in the context of authenticating users or with other control flow issues. The direct approach would be to subclass the ActionServlet controller servlet, and override a method like processActionPerform (which actually calls the selected Action) or processActionForward (which forwards control to the returned logical page name). You could then inspect the current state of the world, and inject flow-of-control changes like this still utilizing the superclass’s basic functionality. To make the types of things you inject somewhat configurable, you might also want to use your own custom ActionMapping subclass, with extra bean properties that describe (to your override method) what exceptional things to do and when to do them — the selected ActionMapping instance is made available to most of the processing calls, so this informat