p.s. Not to say that this isn't still possible. I think more and more
the new "way" of carrying state around on the client side (a necessity
for high load sites) will be more use of the native (or virtual with
Dojo ) storage provider API's available in some browsers. (Dojo uses
the native firefox method when available, as well as a few others like
flash / the controversial inclusion of a db in the new java 6 jre /
etec.)..

I know bank of america has started storing lots more state this way. I
haven't had time yet but have wanted to provide a state manager for
"flash" storage that utilizes the available mechanisms in a cookie
like way - only without all the baggage.. If you're using Dojo (which
you are if you're on >= 4.1) there's no reason at all why you
shouldn't be able to use the storage api that's available. It's not
"alpha" quality at all. Quite the opposite.

On 2/12/07, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:
It is hard to say. What version of Tapestry are you working with?

Not my business to say, but I'd be more than a little worried about
trying to store so much state in a cookie object. Despite the relative
ease with which different API's make it possible to muck around with
them most people don't realize that the very large/cumbersome penalty
for this nicety is that all cookie state must be transmitted on each
http request. Just think of it like running with weights on your legs.

On 2/12/07, Manri Offermann <[EMAIL PROTECTED]> wrote:
> Hi Tapestry users,
>
> I am trying to store an ASO in a cookie. I have read previous posts about 
problems when the cookie is written and that the issue was fixed, but I still seem 
to have problems.
>
> Somehow the store() method of my CookieScopeManager does not write anything 
to the cookie at all.
>
> Is this issue still related to TAPESTRY-825? Can somebody help me out?
>
> Best regards,
>
> Manri
>
>
> Here is my CookieScopeManager:
>
> public class CookieScopeManager implements StateObjectPersistenceManager {
>
>     private String applicationId;
>  private CookieSource cookieSource;
>  private DataSqueezer dataSqueezer;
>
>  /**
>   * @see 
org.apache.tapestry.engine.state.StateObjectPersistenceManager#exists(java.lang.String)
>   */
>  public boolean exists(String objectName) {
>         return cookieSource.readCookieValue(buildKey(objectName)) != null;
>  }
>
>  /**
>   * @see 
org.apache.tapestry.engine.state.StateObjectPersistenceManager#get(java.lang.String,
 org.apache.tapestry.engine.state.StateObjectFactory)
>   */
>  public Object get(String objectName, StateObjectFactory factory) {
>   String key = buildKey(objectName);
>
>         String value = cookieSource.readCookieValue(key);
>         if (value == null)
>          value = "X"; // NullDataSqueezerFilter
>         Object result = dataSqueezer.unsqueeze(value);
>         if (result == null) {
>          System.out.println("create");
>          result = factory.createStateObject();
>          cookieSource.writeCookieValue(key, dataSqueezer.squeeze(result));
>         }
>         System.out.println(ReflectionToStringBuilder.toString(result));
>         return result;
>  }
>
>  /**
>   * @see 
org.apache.tapestry.engine.state.StateObjectPersistenceManager#store(java.lang.String,
 java.lang.Object)
>   */
>  public void store(String objectName, Object stateObject) {
>   try {
>    throw new Exception();
>   } catch (Exception e) {
>    e.printStackTrace();
>   }
>   String key = buildKey(objectName);
>         cookieSource.writeCookieValue(key, dataSqueezer.squeeze(stateObject));
>         System.out.println(ReflectionToStringBuilder.toString(stateObject));
>         cookieSource.writeCookieValue("foo", "bar");
>  }
>
>     private String buildKey(String objectName) {
>         return "state:" + applicationId + ":" + objectName;
>     }
>
>  /**
>   * @param applicationId the applicationId to set
>   */
>  public void setApplicationId(String applicationId) {
>   this.applicationId = applicationId;
>  }
>
>  /**
>   * @param cookieSource the cookieSource to set
>   */
>  public void setCookieSource(CookieSource cookieSource) {
>   this.cookieSource = cookieSource;
>  }
>
>  /**
>   * @param dataSqueezer the dataSqueezer to set
>   */
>  public void setDataSqueezer(DataSqueezer dataSqueezer) {
>   this.dataSqueezer = dataSqueezer;
>  }
> }


--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com



--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to