try to implement a Dispatcher. it is executed in a pipeline on every 
request. you can analyze the request (parameters) and set a ASO
object if necessary. to set an ASO object programmatically you need
to inject the ApplicationStateManager service. 

there is an article in the wiki that describes how to write a dispatcher 
to check 
if a user is logged in.

g,
kris





daniel joyce <daniel.a.jo...@gmail.com> 
09.04.2009 07:31
Bitte antworten an
"Tapestry users" <users@tapestry.apache.org>


An
users@tapestry.apache.org
Kopie

Thema
"User" service?







So I want to use pages with context so that it is easily bookmarkable.

My website uses a DataSourcerealm to determine which pages can be
accessed by a user.

So normal flow is user logs in, first page he gets directed to sets up
the User object as a ASO, other pages use this user.

But if he bookmarks a url with context, say "configureProject/124332",
and he clickes on the bookmark, logs in to tomcat, and gets redirected
to it, the User object may not have been initialized yet. Now
configure project is fine, since it is mostly working with projects.
But I want the user object to exist so that I confirm the user
actually owns it.

Now I could have a basepage, whose onActivate() grabs the auth'd user
string from the Httpsession, runs a query, and either sets up the User
object, or bounces out the login page. And every other page could
inherit from this one, and call super.OnActivate in their onActivate
method.

But I was wondering, is there a service I can write that can examine
the HttpSession, and populate the User object. Is HttpSession
available to services already? IE, can I inject it in the usual method
via my builder?

-Daniel

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


Reply via email to