开发者

goog app engine Problem with setting Attribute

I am having a little trouble getting an attribute that I am setting in one jsp page:

pageContext.setAttribute("purchaser", purchaser, PageContext.SESSION_SCOPE);

and by calling it in other parts of the site via

This works in the google app engine development environment, but doesn't work once it is deployed to the re开发者_StackOverflow中文版al google app engine. Does anyone know why this isn't working and what if any work around exists.


Have you turned on sessions in appengine-web.xml?

 <sessions-enabled>true</sessions-enabled>

See http://code.google.com/appengine/docs/java/config/appconfig.html at the section "Enabling Sessions".

Similar problems with sessions are found on the internet if you do a Google search. Note that, besides enabling sessions, the object you want to store must implement Serializable, or be of one of the supported data types in Memcache and Datastore.

Under the hood, the sessions are stored in the memcach (for speed) and datastore anyway. Using these API's directly might resolve your problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜