Dave,
When you say "I define it by name in applicationContext.xml", what do you
mean?
I tried following the documentation where they instruct to place the name of
the Spring bean in class attribute for the action definition in the
struts.xml. I assume this is what you are doing as well, correct?
I too am using the prototype attribute in the Spring action bean
definitions, as weill as the lazy-init=true .
I should have mentioned, I am currently I was using 2.0.5 and upgraded to
2.0.6 trying to find a workaround to the issue.
I got a hold of the struts and xworks code. Looks like the instantiation of
the action beans is initiated from the initialization of the Struts 2
FilterDispatcher defined in the web.xml. It appears this is the normal
course of getting Struts 2 initialized.
The interesting thing is that the only purpose of this bean instantiation is
to get a hold of the implementation class to verify that it has a no arg
constructor and that it is public. Couldn't this verification be done
wihtout actually instatiating the bean and only examining the metadata or,
more simply skipped and allow for the problem to surface when the action is
actually called (maybe via a configuration parameter)?

Marco



Dave Newton-4 wrote:
> 
> --- Marco from Balboa <[EMAIL PROTECTED]> wrote:
>> but I am also encountering that it is happening at 
>> application startup too.
> 
> If I put a debug stmt in an Action ctor I don't see it
> on startup, only on a request. I am running under
> Tomcat 5.5, also using Spring.
> 
> Ah, if I define it by name in applicationContext.xml
> it is constructed.
> 
> I'm betting you left off the scope="prototype"
> attribute (for XSD-style config) or... um...
> singleton="false" for DTD?
> 
> IIRC beans default to singletons, which is not a good
> thing for S2, obviously.
> 
> d.
> 
> 
> 
>  
> ____________________________________________________________________________________
> Don't get soaked.  Take a quick peek at the forecast
> with the Yahoo! Search weather shortcut.
> http://tools.search.yahoo.com/shortcuts/#loc_weather
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Lazy-loading-actions-in-Struts-2-tf3404803.html#a9488450
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to