comparison gwt-client/src/main/java/org/dive4elements/river/client/server/LoginServlet.java @ 8203:238fc722f87a

sed 's/logger/log/g' src/**/*.java
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 05 Sep 2014 13:19:22 +0200
parents ea9eef426962
children c668520cc5fb
comparison
equal deleted inserted replaced
8202:e4606eae8ea5 8203:238fc722f87a
22 import org.dive4elements.river.client.server.auth.AuthenticationFactory; 22 import org.dive4elements.river.client.server.auth.AuthenticationFactory;
23 import org.dive4elements.river.client.server.features.Features; 23 import org.dive4elements.river.client.server.features.Features;
24 24
25 public class LoginServlet extends AuthenticationServlet { 25 public class LoginServlet extends AuthenticationServlet {
26 26
27 private static Logger logger = Logger.getLogger(LoginServlet.class); 27 private static Logger log = Logger.getLogger(LoginServlet.class);
28 28
29 @Override 29 @Override
30 protected void doPost(HttpServletRequest req, HttpServletResponse resp) 30 protected void doPost(HttpServletRequest req, HttpServletResponse resp)
31 throws ServletException, IOException 31 throws ServletException, IOException
32 { 32 {
33 String encoding = req.getCharacterEncoding(); 33 String encoding = req.getCharacterEncoding();
34 String username = req.getParameter("username"); 34 String username = req.getParameter("username");
35 String password = req.getParameter("password"); 35 String password = req.getParameter("password");
36 36
37 logger.debug("Processing post request"); 37 log.debug("Processing post request");
38 38
39 if (username == null || password == null) { 39 if (username == null || password == null) {
40 logger.debug("No username or password provided"); 40 log.debug("No username or password provided");
41 this.redirectFailure(resp, req.getContextPath()); 41 this.redirectFailure(resp, req.getContextPath());
42 return; 42 return;
43 } 43 }
44 44
45 try { 45 try {
46 Authentication aresp = this.auth(username, password, encoding); 46 Authentication aresp = this.auth(username, password, encoding);
47 if (aresp == null || !aresp.isSuccess()) { 47 if (aresp == null || !aresp.isSuccess()) {
48 logger.debug("Authentication not successful"); 48 log.debug("Authentication not successful");
49 this.redirectFailure(resp, req.getContextPath()); 49 this.redirectFailure(resp, req.getContextPath());
50 return; 50 return;
51 } 51 }
52 this.performLogin(req, resp, aresp.getUser()); 52 this.performLogin(req, resp, aresp.getUser());
53 } 53 }
54 catch(AuthenticationException e) { 54 catch(AuthenticationException e) {
55 logger.error(e, e); 55 log.error(e, e);
56 this.redirectFailure(resp, req.getContextPath(), e); 56 this.redirectFailure(resp, req.getContextPath(), e);
57 } 57 }
58 } 58 }
59 59
60 private Authentication auth(String username, String password, String encoding) 60 private Authentication auth(String username, String password, String encoding)

http://dive4elements.wald.intevation.org