Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Struts Wiki" for change 
notification.

The following page has been changed by BrianManahan:
http://wiki.apache.org/struts/ActionContext

The comment on the change is:
added missing word "time"

------------------------------------------------------------------------------
  ActionContext context = ActionContext.getContext();
  }}}
  
- Think about that for a moment... you can get it from '''any''' class at 
'''any'''.  This means that you can have a helper class called from an Action, 
and if it happens to need access to !ServletContext (maybe it is writing a file 
and needs !ServletContext to get a path to it), you can do so, you '''do not''' 
have to explicitly pass that information to the helper.
+ Think about that for a moment... you can get it from '''any''' class at 
'''any''' time.  This means that you can have a helper class called from an 
Action, and if it happens to need access to !ServletContext (maybe it is 
writing a file and needs !ServletContext to get a path to it), you can do so, 
you '''do not''' have to explicitly pass that information to the helper.
  
  Two other important things about this is that (a) you should always be able 
to go to the same place to get the information you need, the !ActionContext, as 
opposed to Struts where it is scattered across the Request, Response, 
!ActionMapping, etc. objects, and (b) your Actions can be POJOs because there 
are no requirements for any method to have a specific signature.  Think of the 
method signature of the Struts Action class:
  

Reply via email to