Hi Modified my RequestFiler in my AppModule to handle the @secured
annotation which seemed to have done the trick. If its not null return
true and continue with request response.
public boolean service(final Request request, final Response response,
final RequestHandler handler) throws IOException, TapestryException {
....
Component page = componentSource.getPage(pageName);
Secured secured = page.getClass().getAnnotation(Secured.class);
// if page has Secured annotation, send
// redirect to login page...
if (secured != null) {
log.warn(String.format("Page: %s requires user to be
logged in, redirecting to home page...", pageName));
response.sendRedirect(request.getContextPath() +
loginPage);
// return true to indicate we have processed the request
// and so the pipeline is finished
return true;
}
.....
}
......
-----Original Message-----
From: Thiago H. de Paula Figueiredo [mailto:[email protected]]
Sent: Friday, July 24, 2009 6:39 AM
To: Tapestry users
Subject: Re: @Secured annotation handling
Em Thu, 23 Jul 2009 17:53:59 -0300, Norman Franke <[email protected]>
escreveu:
> I've got it working, but note that many event actions are called on
> the page before it figures out that it needs to secure the page. I'd
> run into errors before the secure tag kicked in and redirected to my
> login page. Odd, but workable.
Maybe because its current implementation only does the checks *after*
onActivate() is invoked.
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]