You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Luana <lu...@gmail.com> on 2011/07/15 17:03:03 UTC

Is possible to use an spring bean to carry a SessionState object within a dispatcher?

Hi again!

We are using tapestry 5.1.0.5, and by the moment, we can't change it.

We need some mechanism to know the previous page from any page. Therefore,
we want to hide that the implementation is made with a sessionState object.
So our idea was to save the sessionState object inside an spring bean.

We decided to contribute with a service to the Tapestry MasterDispatcher by
adding a new dispatcher (which acts before the PageRender dispatcher). Thus,
in our dispatcher we injected a bean for carrying the SSO, but we had a
problem by trying to access from different sessions. Even the id of the SSO
was different, its content was the same for all sessions.

Later, we tried to make that the bean wasn't a singleton bean, because we
thought that the problem was related to the bean itself. However, this
approach isn't useful for us because a new instance is created every time is
requested, loosing the SSO.

Finally, we decided to implement it as a SSO directly, but we would like to
know if exists a way of using the bean.

We hope for your answer.
Regards.


--
View this message in context: http://tapestry.1045711.n5.nabble.com/Is-possible-to-use-an-spring-bean-to-carry-a-SessionState-object-within-a-dispatcher-tp4591010p4591010.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Is possible to use an spring bean to carry a SessionState object within a dispatcher?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, 15 Jul 2011 12:03:03 -0300, Luana <lu...@gmail.com>  
wrote:

> Hi again!

Hi!

> We need some mechanism to know the previous page from any page.  
> Therefore, we want to hide that the implementation is made with a  
> sessionState object. So our idea was to save the sessionState object  
> inside an spring bean.

Why don't you use the ApplicationStateManager service to get and set the  
session state object and just pass it as a method parameter to your Spring  
bean?

Without code, we can't help you on why your code doesn't work. By the way,  
try to use a PageRenderRequestFilter would be better suited than a  
Dispatcher for that.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org