You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Musachy Barroso (JIRA)" <ji...@apache.org> on 2008/12/18 22:30:37 UTC

[jira] Resolved: (WW-1821) Provide mechanism to avoid instantiating Spring managed actions at startup

     [ https://issues.apache.org/struts/browse/WW-1821?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Musachy Barroso resolved WW-1821.
---------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 2.2.x)
                   2.1.3

Fixed on xwork trunk

> Provide mechanism to avoid instantiating Spring managed actions at startup
> --------------------------------------------------------------------------
>
>                 Key: WW-1821
>                 URL: https://issues.apache.org/struts/browse/WW-1821
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Actions
>    Affects Versions: 2.0.6
>            Reporter: marco ocana
>            Priority: Minor
>             Fix For: 2.1.3
>
>
> When Spring is used as the object factory for actions, Struts 2 will instantiate at application load time  each of the action beans defined in struts.xml.  
> It would be very useful to to have a way to avoid this behavior, particularly during development.  Because of dependencies defined in Spring, instantiating the action objects can also mean instantiating expensive resources such as datasources that might not be immediately needed. 
> This feature can make the difference between restarting the application in 10 seconds versus multiple minutes. Would be a big development productivity boost.
> It appears that the instantiation of actions occurs in the process of verifying struts.xml. Specifically, it checks that the classes that implement the actions have no-arg constructors that are public.
> In the case of the default ObjectFactory, the class defined in the configuration is loaded and evaluated using the reflection API. When the SpringObjectFactory is used however, the action implementation class is obtained by requesting the action bean from Spring and then getting its class. 
> Ideally, we would examine metadata and determine the validity of the action definition without actually creating the action object. 
> If it turns out that the verification cannot avoid instantiating actions, then I propose that a configuration option be provided that would short-circuit checking the action classes, presumably in struts.properties . 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.