struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <>
Subject Re: struts2+spring+hibernate, objects instantiate order?
Date Thu, 14 May 2009 02:25:00 GMT
ren sky wrote:
> 1) before running my project, spring has already instantiate all the
> object defined in the applicationContext.xml?
>    such as LoginAction,PersonServiceImpl and sessionFactory?

Singletons probably are, sure.

> 2) the action  used in struts2 is instantiated before a request comes
> in? or is instantiated  when a real request comes in?

Yes. IIRC Spring will try to instantiate objects on startup to make sure 
they can be instantiated as defined (I could be wrong about that).

Actions are definitely created per-request (assuming they're "prototype" 
scope, which they should be).

> 3) with spring,what is the role of struts2 ? it seems that the
> responsibility of instantiate object is changed to spring, not
> struts2.

Struts 2 is the web layer. You know, handling requests.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message