Hi,

I'm tasked with killing a bug related to session management and Struts 1.3.10 
in a rather conventional JEE web application. The problem is that after the 
session times out, the application throws a rather ugly exception, something 
like:

2009-11-04 11:45:46,803 ERROR de.mypackage.ipad.util.hibernate.HibernateFilter 
- An Exception occured.
javax.servlet.ServletException: BeanUtils.populate
        at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254)
        at 
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
        at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
        at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
        at...

What I understand is that after the session is gone, the internal Struts 
processing tries to put some data into session-stored objects. It does so with 
help of Apache BeanUtils and I'm aware that this will crash, of course. My goal 
is to present a page with a clean message that the session is gone and the user 
has to re-enter the application. Catching the ServletException at application 
level (via web.xml) is a bad idea because of the rather generic exception 
thrown. My current take is that I need a filter which is called before the 
Struts servlet is called and the filter checks the session beforehand via 
standard Java API (isNew()). For a new session the user is redirected to a 
descriptive error page. This might work if the user is already in the 
application and takes a break, but isNew() will return true at the first entry 
as well which is nonsense, of course. 

What is the best practice to deal with this problem for a Struts 1.3 
application? Or is this not a standard problem and the cause might be something 
different?


Mit freundlichen Grüßen


Maik Himstedt

T-Systems on site services GmbH
Procurement Systems
Telefon/phone: +49-5361-9-44026
E-Mail: extern.maik.himst...@volkswagen.de
--------------------------------------------------------------------------------

Maik Himstedt
Consultant
Benzstraße 25a, 38446 Wolfsburg
+49-5361-464 78-0 (Tel.)
+49-5361-464 78-10 (Fax)
E-Mail: maik.himst...@t-systems.com
Internet: http://www.t-systems-onsite.de 

Geschäftsführung: Stefan Kappe, Thomas Müller-Braun
Handelsregister: Amtsgericht Berlin HRB 51336
Sitz der Gesellschaft: Berlin

Reply via email to