You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Yohan Yudanara <yy...@balicamp.com> on 2007/05/03 07:29:42 UTC
HttpSession And Hivemodule state-object
What is the difference between accessing HttpSession directly using this injection:
<inject property="request" object="service:tapestry.globals.HttpServletRequest"/>
and using hivemodule.xml state-object like this:
<contribution configuration-id="tapestry.state.ApplicationObjects">
<state-object name="cart" scope="session">
<create-instance class="java.util.ArrayList"/>
</state-object>
</contribution>
Is there any advantages and disadvantages?
Which one is recommended?
Thanks..
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: HttpSession And Hivemodule state-object
Posted by Hugo Palma <hu...@gmail.com>.
The difference is the amount of coding that you have to do.
If you don't use ASOs you'll have to implement the code that puts your
object in session, the string constant that has the name of the session
attribute, in every page/component that you want to access the value you'll
have access the session again. Also, if you declare the state object in
hivemind you get all the goodies like dependency injection, etc...
Hope this helped,
Hugo
On 5/3/07, Yohan Yudanara <yy...@balicamp.com> wrote:
>
> What is the difference between accessing HttpSession directly using this
> injection:
> <inject property="request" object="service:
> tapestry.globals.HttpServletRequest"/>
>
> and using hivemodule.xml state-object like this:
> <contribution configuration-id="tapestry.state.ApplicationObjects">
> <state-object name="cart" scope="session">
> <create-instance class="java.util.ArrayList"/>
> </state-object>
> </contribution>
>
> Is there any advantages and disadvantages?
> Which one is recommended?
>
> Thanks..
>
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>