Actually, the 2nd request (which clears the session) is not a manually created Ajax.Request. Sorry for the confusion.

It's actually a async form submit, and to simplify the issue somewhat every submit of this form prints a different sessionId:

   <t:form t:id="someForm" t:zone="someZone">
       <input t:type="TextField" t:id="someInput" />
       <input type="submit" value="search" />
   </t:form>

   @Inject
   private HttpServletRequest request;

   Object onSuccessFromSomeForm()
   {
LOG.debug("onSuccessFromSomeForm " + httpRequest.getSession().getId());
       return null;
   }

Surely that can't be correct?

p.

Paul Stanton wrote:
Thiago,

I tried with @SessionState(create=false) and the same occurs (testing the field for null).

I also tried (as a sanity check) to inject HttpRequest and manage the session attribute manually. Interestingly, the session Id is changing!

This must be the cause - somehow my manual Ajax.Request to a url derived from resources.createEventLink().toAbsoluteURI() is creating a new session....

p.

Thiago H. de Paula Figueiredo wrote:
On Thu, 27 May 2010 23:32:38 -0300, Paul Stanton <p...@mapshed.com.au> wrote:

Hi Thiago,

Hi!

please bare with me... I'm not imagining it. I'm guessing it's something to do with my manually created ajax request...

Tapestry's session handling works the same regardless how the request was made.

I'm not inspecting via debugger, I'm testing the value of the field in code, ie:

via @Persist("session")
if (persistentField == null) LOG.debug("state reset");

I don't know if that's the case, but a persistent field from a given page is only accessible in the same page, even when some other page has a similar field.

and via the @SessionState
if (!persistentFieldExists) LOG.debug("state reset");

Use @SessionState(create = false) instead and test for null.


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



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

Reply via email to