You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Oscar <os...@gmail.com> on 2011/01/04 23:04:07 UTC

Initialize and inject resources per application - S2

Hi to all, i have a question about Struts 2 capabilities. Maybe it sounds
dumb, but yesterday i realized that, when you work with Hibernate, you have
to initialize one SessionFactory per application, not per session as i
believed. So i don't know if struts2 provides some mechanism to initialize
resources once per application and set in application context for example,
or i have to look for other choices like Spring.

Regards.

-- 
Oscar Calderón
SCJP 6  <http://javahowto.net>

Re: Initialize and inject resources per application - S2

Posted by Oscar <os...@gmail.com>.
Well, i really don't know Spring but i'm going to learn soon, also that
plugin shows interesting and is recently updated, i'm gonna check it out.

Thanks to all

2011/1/4 Maurizio Cucchiara <ma...@gmail.com>

> I usually use spring open session in view filter, but obviously there are
> other way. I'm don't know if out is exactly what you need:
> http://community.jboss.org/wiki/OpenSessioninView
> There is a struts plug-in too
> https://cwiki.apache.org/S2PLUGINS/full-hibernate-plugin.html
>
> Maurizio Cucchiara
>
> On Jan 5, 2011 3:06 AM, "aum strut" <au...@gmail.com> wrote:
> Struts2 has its own Object creation way an Object factory which is
> responsible for creating all framework required objects
> like Actions,Interceptors Results etc.
>
> And its flexible enough if you want to let spring do this for Struts2 you
> can always do that by using Spring with struts2
>
>
> On Wed, Jan 5, 2011 at 3:34 AM, Oscar <os...@gmail.com> wrote:
>
> > Hi to all, i have a ques...
>



-- 
Oscar Calderón
SCJP 6  <http://javahowto.net>

Re: Initialize and inject resources per application - S2

Posted by Maurizio Cucchiara <ma...@gmail.com>.
I usually use spring open session in view filter, but obviously there are
other way. I'm don't know if out is exactly what you need:
http://community.jboss.org/wiki/OpenSessioninView
There is a struts plug-in too
https://cwiki.apache.org/S2PLUGINS/full-hibernate-plugin.html

Maurizio Cucchiara

On Jan 5, 2011 3:06 AM, "aum strut" <au...@gmail.com> wrote:
Struts2 has its own Object creation way an Object factory which is
responsible for creating all framework required objects
like Actions,Interceptors Results etc.

And its flexible enough if you want to let spring do this for Struts2 you
can always do that by using Spring with struts2


On Wed, Jan 5, 2011 at 3:34 AM, Oscar <os...@gmail.com> wrote:

> Hi to all, i have a ques...

Re: Initialize and inject resources per application - S2

Posted by aum strut <au...@gmail.com>.
Struts2 has its own Object creation way an Object factory which is
responsible for creating all framework required objects
like Actions,Interceptors Results etc.

And its flexible enough if you want to let spring do this for Struts2 you
can always do that by using Spring with struts2

On Wed, Jan 5, 2011 at 3:34 AM, Oscar <os...@gmail.com> wrote:

> Hi to all, i have a question about Struts 2 capabilities. Maybe it sounds
> dumb, but yesterday i realized that, when you work with Hibernate, you have
> to initialize one SessionFactory per application, not per session as i
> believed. So i don't know if struts2 provides some mechanism to initialize
> resources once per application and set in application context for example,
> or i have to look for other choices like Spring.
>
> Regards.
>
> --
> Oscar Calderón
> SCJP 6  <http://javahowto.net>
>