You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Aidan Connolly <Ai...@xcom.de> on 2004/08/24 14:34:33 UTC
RE: handling stale sessions [auf Viren geprueft] Interesting unexplained
Solution
The problem is now fixed by returning null from my listener method
immediately on detecting the session object (Visit ) is null.
The only problem now is my lack of understanding of why it is now working
.
I am using my engine as I put a println in the no
arg constructor as Jon suggested. Thanks Jon.
I also implement the PageRenderListener interface but when I let the
session timeout on the page and then refresh the page the
pageBeginRender method is not called.
My code is so simple that I should have explained the problem better on my
first mail, excuse me.
On the html template I have a simple Select type component
<select jwcid="docTypes@Select">
<span jwcid=
"listDocTypes@Foreach" source="ognl:docTypes" value="ognl:docItem" index=
"ognl:docTypeIndex">
<option jwcid=
"selectedDocType@Option" selected="ognl:docType" label="ognl:docItem.name"
/>
</span>
<option jwcid="$remove$">
Invoice</option>
<option jwcid="$remove$">
Timesheets</option>
</select>
On my Page class...
/**
*
* @return collection of DocTypeDaos
*/
public Collection getDocTypes() throws Exception{
log.info("getDocTypes called ");
Visit visit = (Visit)getVisit();
if (visit == null ) {
log.info("returning null");
/* this returns user to log in page but why? */
return null;
}
if (docTypes == null) {
docTypes = getRemote().getDocTypesForClient(getClientId());
}
return docTypes;
}
when the method getDocTypes() is called on my Java class I used to get a
null pointer exception getting my logged in client whose session has
ended.
My problem was to forward the user to the login page in this scenario.
I have installed the eclipse plugin debugger for JBoss, JBoss -IDE when I
return from the method I get to the the OgnlRuntime.invokeMethod via the
sun.reflect and java.reflect packages.
I have no more debug messages from my packages but my page miracillously
gets forwarded to my log in page.
amazing,
Aidan (in Dublin)
"Jonathan O'Connor" <Jo...@xcom.de>
18/08/2004 17:59
Please respond to
"Tapestry users" <ta...@jakarta.apache.org>
To
"Tapestry users" <ta...@jakarta.apache.org>
cc
Subject
RE: handling stale sessions [auf Viren geprueft]
Jon,
I work for Aidan, so I can answer for him.
Sadly, we are already extending from BasEngine. I guess I will have to get
out the debugger or add more trace lines to see what is going on.
I'll report back what I find.
Ciao,
Jonathan O'Connor
XCOM Dublin
"Jon Newton" <jo...@SCANSOFTWARE.COM>
18/08/2004 15:31
Please respond to
"Tapestry users" <ta...@jakarta.apache.org>
To
"Tapestry users" <ta...@jakarta.apache.org>
cc
Subject
RE: handling stale sessions [auf Viren geprueft]
Are you sure your engine is being used? You can put a println in the no
arg constructor to verify this.. What happens if you extend BaseEngine
instead of AbstractEngine? That's what I do and my
handleStaleSessionException method works fine.
Jon
> -----Original Message-----
> From: Aidan Connolly [mailto:Aidan.Connolly@xcom.de]
> Sent: Tuesday, August 17, 2004 9:31 AM
> To: tapestry-user@jakarta.apache.org
> Subject: handling stale sessions [auf Viren geprueft]
>
> Is there any way to forward to another page if the request
> cycle is null?
>
> I have over ridden the protected void
> handleStaleSessionException from AbstractEngine in my defined
> engine class but it is not beng called when the page times
> out. If I refresh an 'expired' page, my visit object is null
> so I need to forward the user to the log in page, however when I call
> getPage().getRequestCycle() the retrieved cycle is null.
>
> Many thanks, Aidan.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org