Hi,

I've managed to use JSF 2 quite well with PrimeFaces. In config files I'm 
using the configuration for JSF + App Engine found in many tutorials and I'm 
using Client as state saving method. For libraries I'm using 
Mojarra-2.1.2-FCS, Primefaces-2-2.RC1-SNAPSHOT and JSTL 1.1.
I had problems with sessions until I found out that GAE doesn't store 
(synchronize) the session at all unless something has been set to it. I 
think JSF sets session beans to session only once and after that it just 
gets the instance from the session. So after the first request changes to 
session beans are not stored. Same problem seems to affect also state saving 
(I'm not 100% sure about this). 

I added a method to my session beans to set the bean to session and I call 
that every time some value in the bean has changed.
Basically this is what I added to all my session beans:
private void fixSession() {
        MySessionBean sb = (MySessionBean)((HttpSession) 
FacesContext.getCurrentInstance().getExternalContext().getSession(true)).getAttribute("myBean");
        ((HttpSession) 
FacesContext.getCurrentInstance().getExternalContext().getSession(true)).setAttribute("myBean",
 
sb);
    }
and I call fixSession() every time some data changes in the bean. Another 
approach might be to create a filter to execute on every web request to get 
& set session beans from session. 
For me this fixed most of the problems with JSF.  

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/-dKTFUC1vBkJ.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to