Title: [waffle-scm] [426] trunk/waffle-core/src/main/java/org/codehaus/waffle/servlet/WaffleServlet.java: Use static string constants where possible.
Revision
426
Author
mauro
Date
2007-11-25 04:49:23 -0600 (Sun, 25 Nov 2007)

Log Message

Use static string constants where possible.

Modified Paths


Diff

Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/servlet/WaffleServlet.java (425 => 426)

--- trunk/waffle-core/src/main/java/org/codehaus/waffle/servlet/WaffleServlet.java	2007-11-25 10:43:41 UTC (rev 425)
+++ trunk/waffle-core/src/main/java/org/codehaus/waffle/servlet/WaffleServlet.java	2007-11-25 10:49:23 UTC (rev 426)
@@ -50,6 +50,8 @@
     private static final String DEFAULT_VIEW_SUFFIX = ".jspx";
     private static final String DEFAULT_VIEW_PREFIX = "/";
     private static final String EMPTY = "";
+    private static final String ERROR = "ERROR: ";
+    private static final String POST = "POST";
     private ActionMethodExecutor actionMethodExecutor;
     private ActionMethodResponseHandler actionMethodResponseHandler;
     private ServletMonitor servletMonitor;
@@ -165,7 +167,7 @@
                     view = buildViewToReferrer(controllerDefinition);
                 } else if (actionMethodResponse.getReturnValue() == null) {
                     // Null or VOID indicate a Waffle convention (return to referring page)
-                    if (request.getMethod().equalsIgnoreCase("POST")) {
+                    if (request.getMethod().equalsIgnoreCase(POST)) {
                         // PRG (Post/Redirect/Get): see http://en.wikipedia.org/wiki/Post/Redirect/Get
                         String url = ""
                         view = new RedirectView(url, controllerDefinition.getController());
@@ -183,7 +185,7 @@
             actionMethodResponseHandler.handle(request, response, actionMethodResponse);
         } catch (ActionMethodInvocationException e) {
             servletMonitor.servletServiceFailed(e);
-            log("ERROR: " + e.getMessage());
+            log(ERROR + e.getMessage());
             response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
         }
     }


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to