• Post Reply Bookmark Topic Watch Topic
  • New Topic

Handling JSF Sessions

 
Don Ch
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having a problem when my session in jsf times out. I have a logoutBean that handles the logout functionality for my app. The problem comes in when the session expires after period of time with no activity on the app. If i try then call the logout() method in my logoutBean i get the following error in Tomcat5.5 listed below (this is only a short extract, the exception thrown is a lot longer) Any idea on how to check if the session has expired before you submit a request??

SEVERE: Managedbean TopBean could not be created Can't instantiate class: 'za.co
.vodacom.rms.frontend.bean.TopBean'.. class za.co.vodacom.rms.frontend.bean.TopB
ean : java.lang.NullPointerException
javax.faces.FacesException: Can't instantiate class: 'za.co.vodacom.rms.frontend
.bean.TopBean'.. class za.co.vodacom.rms.frontend.bean.TopBean : java.lang.NullP
ointerException
at com.sun.faces.config.ManagedBeanFactory.newInstance(ManagedBeanFactor
y.java:229)
at com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreMan
agedBeans(ApplicationAssociate.java:306)
at com.sun.faces.el.VariableResolverImpl.resolveVariable(VariableResolve
rImpl.java:97)
at com.sun.faces.el.impl.NamedValue.evaluate(NamedValue.java:145)
at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:166)
at com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEval
uatorImpl.java:263)
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about adding a filter that checks whether the session is valid or not?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!