You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Stefano Tranquillini <st...@gmail.com> on 2009/04/18 15:29:31 UTC

How share information in a struts application

Hi

i've a conceptual problem.

i want to transport and share inforamtion in my application.
e.g. when a user made the login i want to store that user is loggedin
and its datas.

how can i do that?

in the past version of struts there was the actionform and use ther
around the application.

in struts2 i can't find a guide or tutotiral that explain these steps.

PS: i've a sessionEJB, i can use that class to keep track about my
information, or i've to create a sessionStrutBean and put all the
information inside this bean?

how can i put and get bean in a action?

thanks.


-- 
Stefano

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How share information in a struts application

Posted by Dave Newton <ne...@yahoo.com>.
Stefano Tranquillini wrote:
> If found nothing that can resolve my problem!
> 
> i need to share a class that contains all information that i need
> between all the classes and jsps.
> i've to put a setter and ghetter for each action that i've? i need to
> store some inforamtion in a bean (simple java bean) and share this
> class in all the actions and etc.
> but i'm not able to find out a solution.

Put it in the session.

Implement SessionAware to retrieve the session map if you need the 
object in an action.

If you don't, access it directly in the JSP via OGNL.

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How share information in a struts application

Posted by Stefano Tranquillini <st...@gmail.com>.
If found nothing that can resolve my problem!

i need to share a class that contains all information that i need
between all the classes and jsps.
i've to put a setter and ghetter for each action that i've? i need to
store some inforamtion in a bean (simple java bean) and share this
class in all the actions and etc.
but i'm not able to find out a solution.

On Sat, Apr 18, 2009 at 16:11,  <st...@gmail.com> wrote:
> Hey bro --
>
> Have you read anything about Struts 2 or are you just trying stuff?  The
> form bean is gone and the action is now the action-model.  If you have
> accessible setters on your action-model, OGNL will graph those data onto
> your action-model.  I would recommend a quick Google search for tuorials and
> docs to get a better understanding of the framework.
>
> Peace,
> Scott
>
> On Sat, Apr 18, 2009 at 8:29 AM, Stefano Tranquillini <
> stefano.tranquillini@gmail.com> wrote:
>
>> Hi
>>
>> i've a conceptual problem.
>>
>> i want to transport and share inforamtion in my application.
>> e.g. when a user made the login i want to store that user is loggedin
>> and its datas.
>>
>> how can i do that?
>>
>> in the past version of struts there was the actionform and use ther
>> around the application.
>>
>> in struts2 i can't find a guide or tutotiral that explain these steps.
>>
>> PS: i've a sessionEJB, i can use that class to keep track about my
>> information, or i've to create a sessionStrutBean and put all the
>> information inside this bean?
>>
>> how can i put and get bean in a action?
>>
>> thanks.
>>
>>
>> --
>> Stefano
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>



-- 
Stefano

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How share information in a struts application

Posted by st...@gmail.com.
Hey bro --

Have you read anything about Struts 2 or are you just trying stuff?  The
form bean is gone and the action is now the action-model.  If you have
accessible setters on your action-model, OGNL will graph those data onto
your action-model.  I would recommend a quick Google search for tuorials and
docs to get a better understanding of the framework.

Peace,
Scott

On Sat, Apr 18, 2009 at 8:29 AM, Stefano Tranquillini <
stefano.tranquillini@gmail.com> wrote:

> Hi
>
> i've a conceptual problem.
>
> i want to transport and share inforamtion in my application.
> e.g. when a user made the login i want to store that user is loggedin
> and its datas.
>
> how can i do that?
>
> in the past version of struts there was the actionform and use ther
> around the application.
>
> in struts2 i can't find a guide or tutotiral that explain these steps.
>
> PS: i've a sessionEJB, i can use that class to keep track about my
> information, or i've to create a sessionStrutBean and put all the
> information inside this bean?
>
> how can i put and get bean in a action?
>
> thanks.
>
>
> --
> Stefano
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>