diff options
Diffstat (limited to 'juick-spring-www/src/main/java/com')
-rw-r--r-- | juick-spring-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java | 2 | ||||
-rw-r--r-- | juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/juick-spring-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java b/juick-spring-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java index bb6387d6..d10f2532 100644 --- a/juick-spring-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java +++ b/juick-spring-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java @@ -51,7 +51,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { .loginProcessingUrl("/do_login") .usernameParameter("j_username") .passwordParameter("j_password") - .failureUrl("/login?error=1") + .failureUrl("/login-error") .and() .rememberMe() .tokenValiditySeconds(6 * 30 * 24 * 3600) diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java index 6f25844f..4df4d350 100644 --- a/juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java +++ b/juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java @@ -11,6 +11,7 @@ import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.context.MessageSource; import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -121,6 +122,12 @@ public class IndexController { @RequestMapping(value = "/login", method = RequestMethod.GET) public String getLoginForm() { - return "views/login"; + return "layout/login"; + } + + @RequestMapping(value = "/login-error", method = RequestMethod.GET) + public String getLoginErrorForm(Model model) { + model.addAttribute("loginError", true); + return "layout/login"; } }
\ No newline at end of file |