changeset 4451:e2d8f344491e

Use static variable for login page name in LoginServlet
author Björn Ricks <bjoern.ricks@intevation.de>
date Thu, 08 Nov 2012 10:47:24 +0100
parents 0074c113bb95
children bdf321802d3d
files flys-client/src/main/java/de/intevation/flys/client/server/LoginServlet.java
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/server/LoginServlet.java	Thu Nov 08 10:29:09 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/LoginServlet.java	Thu Nov 08 10:47:24 2012 +0100
@@ -21,11 +21,13 @@
 public class LoginServlet extends HttpServlet {
 
     private static Logger logger = Logger.getLogger(LoginServlet.class);
+
     private static final String FLYS_PAGE = "FLYS.html";
+    private static final String LOGIN_PAGE = "login.jsp";
 
     private void redirectFailure(HttpServletResponse resp, String path)
         throws IOException {
-        resp.sendRedirect(path + "/login.jsp");
+        resp.sendRedirect(path + "/" + LOGIN_PAGE);
     }
 
     private void redirectFailure(HttpServletResponse resp, String path,
@@ -35,7 +37,7 @@
 
     private void redirectFailure(HttpServletResponse resp, String path,
             String message) throws IOException {
-        resp.sendRedirect(path + "/login.jsp?error=" + message);
+        resp.sendRedirect(path + "/" + LOGIN_PAGE + "?error=" + message);
     }
 
     private void redirectSuccess(HttpServletResponse resp, String path,
@@ -110,6 +112,7 @@
         ServletContext sc = this.getServletContext();
         Features features = (Features)sc.getAttribute(Features.CONTEXT_ATTRIBUTE);
         String auth = sc.getInitParameter("authentication");
-        return AuthenticationFactory.getInstance(auth).auth(username, password, encoding, features);
+        return AuthenticationFactory.getInstance(auth).auth(username, password,
+                encoding, features);
     }
 }

http://dive4elements.wald.intevation.org