I have managed bean with session as managedbean-scope
, now in constructor of the backing bean, am doing some validation, but since the scope of bean is session
when user first tries to hit upload
page, am calling constructor of managed bean and doing some validation to see if user has access to upload page or no.
So on first try, am calling constructor and i get validation error message saying that upload
page is not available for user, but now if i go to any other tab and click back to upload
page menu tab, that page shows up, how can i change this behavior so that validation is checked on every pageLoad, also I cannot use managed-scoped
as request
for the page, coz i need to maintain some information between different requests in same session.
Here is the code:
Backing Bean Constructor:
public Upload()
{
ValidationStatus authorizeBean = validateUSER(user);
}
Faces-config.xml
<managed-bean>
<managed-bean-name>fileUpload</managed-bean-name>
<managed-bean-class>Upload</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
Any thoughts?