diff options
author | Marc Englund <marc.englund@itmill.com> | 2009-09-08 12:08:17 +0000 |
---|---|---|
committer | Marc Englund <marc.englund@itmill.com> | 2009-09-08 12:08:17 +0000 |
commit | af3f05f607e7d9c39189432e4b4523faf24badd0 (patch) | |
tree | 235cab57b538eb53eb9edf76885903db54a8ef36 /src/com | |
parent | e98080fc2045019f0197d63986900584ac611c81 (diff) | |
download | vaadin-framework-af3f05f607e7d9c39189432e4b4523faf24badd0.tar.gz vaadin-framework-af3f05f607e7d9c39189432e4b4523faf24badd0.zip |
Made error notifications overrideable; final commit for #2835
svn changeset:8710/svn branch:6.1
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/vaadin/terminal/gwt/server/GAEApplicationServlet.java | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/src/com/vaadin/terminal/gwt/server/GAEApplicationServlet.java b/src/com/vaadin/terminal/gwt/server/GAEApplicationServlet.java index 147fb63f57..daab5fbbc4 100644 --- a/src/com/vaadin/terminal/gwt/server/GAEApplicationServlet.java +++ b/src/com/vaadin/terminal/gwt/server/GAEApplicationServlet.java @@ -48,6 +48,27 @@ public class GAEApplicationServlet extends ApplicationServlet { private static final String PROPERTY_EXPIRES = "expires"; private static final String PROPERTY_DATA = "data"; + protected void sendDeadlineExceededNotification(HttpServletRequest request, + HttpServletResponse response) throws IOException { + criticalNotification( + request, + response, + "Deadline Exceeded", + "I'm sorry, but the operation took too long to complete. We'll try reloading to see where we're at, please take note of any unsaved data...", + "", null); + } + + protected void sendNotSerializableNotification(HttpServletRequest request, + HttpServletResponse response) throws IOException { + criticalNotification( + request, + response, + "NotSerializableException", + "I'm sorry, but there seems to be a serious problem, please contact the administrator. And please take note of any unsaved data...", + "", getApplicationUrl(request).toString() + + "?restartApplication"); + } + @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { @@ -142,24 +163,11 @@ public class GAEApplicationServlet extends ApplicationServlet { } catch (DeadlineExceededException e) { System.err.println("DeadlineExceeded for " + session.getId()); - // TODO i18n? - criticalNotification( - request, - response, - "Deadline Exceeded", - "I'm sorry, but the operation took too long to complete. We'll try reloading to see where we're at, please take note of any unsaved data...", - "", null); + sendDeadlineExceededNotification(request, response); } catch (NotSerializableException e) { - // TODO i18n? - // TODO this notification is not shown - solve this in some other - // way... - criticalNotification( - request, - response, - "NotSerializableException", - "I'm sorry, but there seems to be a serious problem, please contact the administrator. And please take note of any unsaved data...", - "", getApplicationUrl(request).toString() - + "?restartApplication"); + // TODO this notification is usually not shown - should we redirect + // in some other way - can we? + sendNotSerializableNotification(request, response); e.printStackTrace(System.err); } finally { // "Next, please!" @@ -170,8 +178,8 @@ public class GAEApplicationServlet extends ApplicationServlet { } } - ApplicationContext getApplicationContext(HttpServletRequest request, - MemcacheService memcache) { + protected ApplicationContext getApplicationContext( + HttpServletRequest request, MemcacheService memcache) { HttpSession session = request.getSession(); String id = AC_BASE + session.getId(); byte[] serializedAC = (byte[]) memcache.get(id); |