How to access session before page loads
Joel Trunick <[email protected]> Tue, 25 Feb 2003 14:31:08 -0600
| Newsgroups | gmane.comp.java.tapestry.devel |
|---|---|
| Message-ID | <[email protected]> |
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C2DD0C.D3BC3C30 Content-Type: text/plain; charset="iso-8859-1" I was in the same boat. I managed solving this problem by making my first Tapestry page an IExternalPage. In the activateExternalPage(RequestCycle) method I call .getVisit() which seems to appropriately setup the session. I then use RequestCycle..getSession() to grab variables out of the existing session. BTW, Remember to encode the link to the page so that it is stateful. Joel --__--__-- Message: 5 Date: Tue, 25 Feb 2003 10:10:39 -0800 (PST) From: Stav <[email protected]> Reply-To: [email protected] To: [email protected] Subject: [Tapestry-developer] How to access session before page loads Hi, I am trying to integrate a prototype Tapestry app with an existing web application that has already set certain user specific parameters in the session. The applications are in the same web context. How would I go about accessing the session before the Home page loads so that I can setup the Home page? I am currently using Tapestry version 2.1. I have tried using BasePage.getRequestCycle(), but this object appears to be null at first page load. Thanks in advance. Cheers, Stav. ------_=_NextPart_001_01C2DD0C.D3BC3C30 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3Diso-8859-1"> <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version = 5.5.2653.12"> <TITLE>How to access session before page loads</TITLE> </HEAD> <BODY> <BR> <BR> <P><FONT SIZE=3D2>I was in the same boat. I managed solving this = problem by making my first Tapestry page an IExternalPage. In the = activateExternalPage(RequestCycle) method I call .getVisit() which = seems to appropriately setup the session. I then use = RequestCycle..getSession() to grab variables out of the existing = session. </FONT></P> <P><FONT SIZE=3D2>BTW, Remember to encode the link to the page so that = it is stateful.</FONT> </P> <P><FONT SIZE=3D2>Joel</FONT> </P> <BR> <P><FONT SIZE=3D2>--__--__--</FONT> </P> <P><FONT SIZE=3D2>Message: 5</FONT> <BR><FONT SIZE=3D2>Date: Tue, 25 Feb 2003 10:10:39 -0800 (PST)</FONT> <BR><FONT SIZE=3D2>From: Stav <[email protected]></FONT> <BR><FONT SIZE=3D2>Reply-To: [email protected]</FONT> <BR><FONT SIZE=3D2>To: [email protected]</FONT> <BR><FONT SIZE=3D2>Subject: [Tapestry-developer] How to access session = before page loads</FONT> </P> <P><FONT SIZE=3D2>Hi,</FONT> </P> <P><FONT SIZE=3D2>I am trying to integrate a prototype Tapestry app = with</FONT> <BR><FONT SIZE=3D2>an existing web application that has already = set</FONT> <BR><FONT SIZE=3D2>certain user specific parameters in the = session.</FONT> </P> <P><FONT SIZE=3D2>The applications are in the same web context.</FONT> </P> <P><FONT SIZE=3D2>How would I go about accessing the session before = the</FONT> <BR><FONT SIZE=3D2>Home page loads so that I can setup the Home = page?</FONT> </P> <P><FONT SIZE=3D2>I am currently using Tapestry version 2.1.</FONT> </P> <P><FONT SIZE=3D2>I have tried using BasePage.getRequestCycle(), = but</FONT> <BR><FONT SIZE=3D2>this object appears to be null at first page = load.</FONT> </P> <P><FONT SIZE=3D2>Thanks in advance.</FONT> </P> <P><FONT SIZE=3D2>Cheers,</FONT> <BR><FONT SIZE=3D2>Stav.</FONT> </P> <BR> </BODY> </HTML> ------_=_NextPart_001_01C2DD0C.D3BC3C30-- ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf