Mercurial > dive4elements > gnv-client
comparison gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java @ 991:33198e55371c
Improved session handling in the gui. If a session has timed out, the user gets to the start point - the fis selection.
gnv/trunk@1192 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 10 Jun 2010 15:13:08 +0000 |
parents | 0441e78cd900 |
children | 28a0628b11b0 |
comparison
equal
deleted
inserted
replaced
990:56b22bc68dfa | 991:33198e55371c |
---|---|
1 package de.intevation.gnv.action; | 1 package de.intevation.gnv.action; |
2 | 2 |
3 import javax.servlet.http.HttpServletRequest; | 3 import javax.servlet.http.HttpServletRequest; |
4 import javax.servlet.http.HttpServletResponse; | 4 import javax.servlet.http.HttpServletResponse; |
5 import javax.servlet.http.HttpSession; | |
5 | 6 |
6 import org.apache.log4j.Logger; | 7 import org.apache.log4j.Logger; |
7 import org.apache.struts.action.Action; | 8 import org.apache.struts.action.Action; |
8 import org.apache.struts.action.ActionForm; | 9 import org.apache.struts.action.ActionForm; |
9 import org.apache.struts.action.ActionForward; | 10 import org.apache.struts.action.ActionForward; |
92 good[i] = encode(s[i]); | 93 good[i] = encode(s[i]); |
93 } | 94 } |
94 | 95 |
95 return good; | 96 return good; |
96 } | 97 } |
98 | |
99 | |
100 protected boolean isSessionExhausted(HttpServletRequest request) { | |
101 HttpSession session = request.getSession(); | |
102 return session.isNew(); | |
103 } | |
104 | |
105 | |
106 protected ActionForward sessionExhaustedForward( | |
107 ActionMapping mapping, ActionForm form, | |
108 HttpServletRequest request, HttpServletResponse response) | |
109 throws Exception | |
110 { | |
111 request.setAttribute( | |
112 CommunicationKeys.REQUEST_EXCEPTION_SESSION_ID, | |
113 "SessionTimeout has occured"); | |
114 | |
115 log.warn("Session timed out."); | |
116 | |
117 return new FetchArtifactFactoriesAction().execute( | |
118 mapping, form, request, response); | |
119 } | |
97 } | 120 } |
98 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 121 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |