You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Lindsay Steele <ls...@iinet.net.au> on 2004/09/09 09:46:10 UTC
Message from Protected page.
Hi,
I am trying to set a message when a protected page is accessed
without authentication.
At the moment I use a protected page similar to this below
public void pageValidate(PageEvent event) {
Visit visit = (Visit) getVisit();
if (visit != null && visit.isAuthenticated()) {
return;
}
// visit.setLatestMessage("Page Access without
Authentication");
throw new PageRedirectException("Home");
}
I want to send a message to the Home page to say there was Page access
without authentication.
How can I do this ?
I came up with a way where I can send a message to a queue in the visit
object .. And then this
Message could be dispayed from the Home page.
The problem appears to be that I am having trouble setting a message
unless it is coming one of the listeners.
Why does this work ...
public void login(IRequestCycle cycle) {
other code here ....
setMessage("Invalid user name or password.");
}
But this not work ....
public void pageBeginRender(PageEvent event)
{
other code here .....
setMessage("Sample message here ..");
}
Is there any way to set the message as the page loads ??
Thanks in advance,
Lindsay Steele
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org