Hi,
I have tried the same code what you have mentioned below, but its
not able to write anything to my cookies...
My code in java is:
@InjectObject("service:tapestry.request.CookieSource")
public abstract CookieSource getCookieSource();
and then,
if(getRememberZzzz()){
if((getUsername() != null) && (getinputPassword() != null)){
getCookieSource1().writeCookieValue("xxx",
getXxxx());
getCookieSource1().writeCookieValue("yyy",
getYyyys());
}
}
Is anything else need to be added to my code that it should work... and also
how do I check through my java code whether cookies are enabled in the
browser or not.....
I am using Tapestry4.0Beta4.0 version....
Please respond with solution,
Thanks in advance,
Regards,
Anjali
-----Original Message-----
From: Shawn Church [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 04, 2005 12:54 AM
To: Tapestry users
Subject: Re: Persistent cookies in T4
Using Annotations, this has worked for me:
@InjectObject("service:tapestry.request.CookieSource")
public abstract CookieSource getCookieSource();
and then:
getCookieSource().readCookieValue(name);
or
getCookieSource().writeCookieValue(name, value);
One limitation is that writeCookieValue does not yet handle expiration
dates (according to the TODO: in CookieSource.java).
The second part of your question would involve hooking into one of the
HiveMind engine services involved in handling each request (possibly
Tapestry.request.WebRequestServicer). In Tapestry 3, it was a simple
matter of overriding BaseEngine and implementing setupForRequest().
Shawn
Quoting Denis Souza <[EMAIL PROTECTED]>:
> Hi,
>
>
>
> I'm trying to create a persistent cookie to be placed in the user's
> browser
> but I just can't figure out how to do it in Tapestry 4. I've looked
> around
> in the list archives and in the docs but I couldn't find anything
> that would
> help me (except for the CookieSource class which didn't seem very
> helpful in
> my case). Anyone know how this can be done?
>
>
>
> Another thing is that for every request I must read this cookie and
> update
> my database with some info (regardless of which page the user is
> accessing)
> and on every response I might have to change the cookie's contents.
> How
> would I go about having a class/method that is called on every
> request/response so that I can read/update this information? I'm
> thinking
> it's some hivemind thing but I guess I'm just not fluent enough with
> it yet.
> Can somebody help me?
>
>
>
> Thanks,
>
> Denis Souza
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]