javaee-samples/javaee7-samples

JSF Server-extension possible scope problem on UserAge bean.

savage-engineer opened this issue · 3 comments

CLOSED FOR AGE

When deploying the Server-extension webapp I noticed that the custom converter wasn't passing the age value given to the bean (checked in Chrome, Firefox and phantomJS). I checked in the server log and saw that the faces converter was correctly getting the value and giving it to a new UserAge bean (had it printing to logs).

I resolved this issue by changing the scope on the UserAge bean from @ApplicationScoped to @SessionScoped, as it seemed to be destroying the bean between the conversion and changing to the converter.xhtml view. I'm not sure if the issue was caused by my deployment/appserver but wouldn't know where to start with that.

I'm new to JSF, appservers and Java in general but thought it was worth noting just in case it isn't just me.

Which app server?

GlassFish 4.1.*

@m-reza-rahman any thoughts?