From 1b8f1ce06df5c1eb09b94368736c4e55f0c48de1 Mon Sep 17 00:00:00 2001 From: egmp777 Date: Fri, 26 Sep 2014 17:45:37 -0500 Subject: [PATCH] ChangesSept26 --- .../persistence/service/IUserService.java | 3 +- .../baeldung/persistence/service/UserDto.java | 3 + .../persistence/service/UserService.java | 16 ++-- .../security/MyUserDetailsService.java | 12 +-- .../java/org/baeldung/spring/MvcConfig.java | 4 +- .../service/EmailExistsException.java | 2 +- .../service/EmailValidator.java | 4 +- .../service/PasswordMatches.java | 2 +- .../service/PasswordMatchesValidator.java | 4 +- .../service/UserValidator.java | 14 +--- .../service/ValidEmail.java | 2 +- .../controller/RegistrationController.java | 24 ++---- .../src/main/resources/application.properties | 6 +- .../src/main/resources/messages_en.properties | 7 ++ .../main/resources/messages_es_ES.properties | 7 ++ .../src/main/resources/webSecurityConfig.xml | 2 +- .../src/main/webapp/WEB-INF/mvc-servlet.xml | 2 +- .../src/main/webapp/WEB-INF/view/admin.jsp | 25 ++++-- .../src/main/webapp/WEB-INF/view/console.jsp | 21 +++-- .../src/main/webapp/WEB-INF/view/home.jsp | 13 ++- .../src/main/webapp/WEB-INF/view/homepage.jsp | 36 ++++---- .../webapp/WEB-INF/view/invalidSession.jsp | 14 +++- .../src/main/webapp/WEB-INF/view/login.jsp | 64 +++++++++------ .../src/main/webapp/WEB-INF/view/logout.jsp | 18 ++-- .../main/webapp/WEB-INF/view/registration.jsp | 82 +++++++++++-------- .../webapp/WEB-INF/view/successRegister.jsp | 15 ++-- .../src/main/webapp/resources/bootstrap.css | 2 +- 27 files changed, 237 insertions(+), 167 deletions(-) rename spring-security-login-error-handling/src/main/java/org/baeldung/{persistence => validation}/service/EmailExistsException.java (79%) rename spring-security-login-error-handling/src/main/java/org/baeldung/{persistence => validation}/service/EmailValidator.java (89%) rename spring-security-login-error-handling/src/main/java/org/baeldung/{persistence => validation}/service/PasswordMatches.java (94%) rename spring-security-login-error-handling/src/main/java/org/baeldung/{persistence => validation}/service/PasswordMatchesValidator.java (84%) rename spring-security-login-error-handling/src/main/java/org/baeldung/{persistence => validation}/service/UserValidator.java (63%) rename spring-security-login-error-handling/src/main/java/org/baeldung/{persistence => validation}/service/ValidEmail.java (94%) diff --git a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/IUserService.java b/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/IUserService.java index f8e0651871..6c9f50acfc 100644 --- a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/IUserService.java +++ b/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/IUserService.java @@ -1,9 +1,10 @@ package org.baeldung.persistence.service; import org.baeldung.persistence.model.User; +import org.baeldung.validation.service.EmailExistsException; public interface IUserService { - public User registerNewUserAccount(UserDto userAccountData) throws EmailExistsException; + public User registerNewUserAccount(UserDto accountDto) throws EmailExistsException; } diff --git a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/UserDto.java b/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/UserDto.java index 61aff31567..af299520fd 100644 --- a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/UserDto.java +++ b/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/UserDto.java @@ -1,6 +1,9 @@ package org.baeldung.persistence.service; import javax.validation.constraints.NotNull; + +import org.baeldung.validation.service.PasswordMatches; +import org.baeldung.validation.service.ValidEmail; import org.hibernate.validator.constraints.NotEmpty; @PasswordMatches public class UserDto { diff --git a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/UserService.java b/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/UserService.java index 1a083c557c..bb84fc81ab 100644 --- a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/UserService.java +++ b/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/UserService.java @@ -1,9 +1,11 @@ package org.baeldung.persistence.service; import javax.transaction.Transactional; + import org.baeldung.persistence.dao.UserRepository; import org.baeldung.persistence.model.Role; import org.baeldung.persistence.model.User; +import org.baeldung.validation.service.EmailExistsException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -14,16 +16,16 @@ public class UserService implements IUserService { @Transactional @Override - public User registerNewUserAccount(UserDto userAccountData) throws EmailExistsException { - if (emailExist(userAccountData.getEmail())) { + public User registerNewUserAccount(UserDto accountDto) throws EmailExistsException { + if (emailExist(accountDto.getEmail())) { - throw new EmailExistsException("There is an account with that email adress: " + userAccountData.getEmail()); + throw new EmailExistsException("There is an account with that email adress: " + accountDto.getEmail()); } User user = new User(); - user.setFirstName(userAccountData.getFirstName()); - user.setLastName(userAccountData.getLastName()); - user.setPassword(userAccountData.getPassword()); - user.setEmail(userAccountData.getEmail()); + user.setFirstName(accountDto.getFirstName()); + user.setLastName(accountDto.getLastName()); + user.setPassword(accountDto.getPassword()); + user.setEmail(accountDto.getEmail()); //ROLE WILL ALWAYS BE USER. HARDCODING IT user.setRole(new Role(Integer.valueOf(1),user)); return repository.save(user); diff --git a/spring-security-login-error-handling/src/main/java/org/baeldung/security/MyUserDetailsService.java b/spring-security-login-error-handling/src/main/java/org/baeldung/security/MyUserDetailsService.java index 7ff7789519..9e57ef2f6d 100644 --- a/spring-security-login-error-handling/src/main/java/org/baeldung/security/MyUserDetailsService.java +++ b/spring-security-login-error-handling/src/main/java/org/baeldung/security/MyUserDetailsService.java @@ -26,18 +26,12 @@ public class MyUserDetailsService implements UserDetailsService { @Autowired private UserRepository userRepository; - // @Autowired - // public MyUserDetailsService(UserRepository repository) { - // this.userRepository = repository; - // } - public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException { try { LOGGER.debug("Loading user by username: {}", email); User user = userRepository.findByEmail(email); LOGGER.debug("Found user: {}", user); if (user == null) { - // throw new UsernameNotFoundException("No user found with username: " + username); boolean enabled = false; return new org.springframework.security.core.userdetails.User(" ", " ", enabled, true, true, true, getAuthorities(new Integer(1))); } @@ -52,7 +46,7 @@ public class MyUserDetailsService implements UserDetailsService { } } - public Collection getAuthorities(Integer role) { + private Collection getAuthorities(Integer role) { List authList = getGrantedAuthorities(getRoles(role)); return authList; } @@ -61,17 +55,15 @@ public class MyUserDetailsService implements UserDetailsService { List roles = new ArrayList(); if (role.intValue() == 2) { - // roles.add("ROLE_USER"); roles.add("ROLE_ADMIN"); } else if (role.intValue() == 1) { roles.add("ROLE_USER"); } - return roles; } - public static List getGrantedAuthorities(List roles) { + private static List getGrantedAuthorities(List roles) { List authorities = new ArrayList(); for (String role : roles) { authorities.add(new SimpleGrantedAuthority(role)); diff --git a/spring-security-login-error-handling/src/main/java/org/baeldung/spring/MvcConfig.java b/spring-security-login-error-handling/src/main/java/org/baeldung/spring/MvcConfig.java index 4c7a84ef86..429ed2342d 100644 --- a/spring-security-login-error-handling/src/main/java/org/baeldung/spring/MvcConfig.java +++ b/spring-security-login-error-handling/src/main/java/org/baeldung/spring/MvcConfig.java @@ -2,8 +2,8 @@ package org.baeldung.spring; import java.util.Locale; -import org.baeldung.persistence.service.PasswordMatchesValidator; -import org.baeldung.persistence.service.EmailValidator; +import org.baeldung.validation.service.EmailValidator; +import org.baeldung.validation.service.PasswordMatchesValidator; import org.springframework.context.MessageSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; diff --git a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/EmailExistsException.java b/spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/EmailExistsException.java similarity index 79% rename from spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/EmailExistsException.java rename to spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/EmailExistsException.java index ad00388f06..7b60bb9f08 100644 --- a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/EmailExistsException.java +++ b/spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/EmailExistsException.java @@ -1,4 +1,4 @@ -package org.baeldung.persistence.service; +package org.baeldung.validation.service; @SuppressWarnings("serial") public class EmailExistsException extends Throwable { diff --git a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/EmailValidator.java b/spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/EmailValidator.java similarity index 89% rename from spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/EmailValidator.java rename to spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/EmailValidator.java index 19907ce504..1ff8c4251f 100644 --- a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/EmailValidator.java +++ b/spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/EmailValidator.java @@ -1,4 +1,4 @@ -package org.baeldung.persistence.service; +package org.baeldung.validation.service; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -20,7 +20,7 @@ public class EmailValidator implements ConstraintValidator { return (validateEmail(username)); } - public boolean validateEmail(String email) { + private boolean validateEmail(String email) { pattern = Pattern.compile(EMAIL_PATTERN); matcher = pattern.matcher(email); return matcher.matches(); diff --git a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/PasswordMatches.java b/spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/PasswordMatches.java similarity index 94% rename from spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/PasswordMatches.java rename to spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/PasswordMatches.java index eb98a73d2c..5499921aed 100644 --- a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/PasswordMatches.java +++ b/spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/PasswordMatches.java @@ -1,4 +1,4 @@ -package org.baeldung.persistence.service; +package org.baeldung.validation.service; import javax.validation.Constraint; import javax.validation.Payload; diff --git a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/PasswordMatchesValidator.java b/spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/PasswordMatchesValidator.java similarity index 84% rename from spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/PasswordMatchesValidator.java rename to spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/PasswordMatchesValidator.java index 18a70637e5..10fa21d02e 100644 --- a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/PasswordMatchesValidator.java +++ b/spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/PasswordMatchesValidator.java @@ -1,8 +1,10 @@ -package org.baeldung.persistence.service; +package org.baeldung.validation.service; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; +import org.baeldung.persistence.service.UserDto; + public class PasswordMatchesValidator implements ConstraintValidator { @Override diff --git a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/UserValidator.java b/spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/UserValidator.java similarity index 63% rename from spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/UserValidator.java rename to spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/UserValidator.java index 45d453b934..45de9e3a94 100644 --- a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/UserValidator.java +++ b/spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/UserValidator.java @@ -1,15 +1,11 @@ -package org.baeldung.persistence.service; +package org.baeldung.validation.service; -import java.util.regex.Matcher; -import java.util.regex.Pattern; +import org.baeldung.persistence.service.UserDto; import org.springframework.validation.Errors; import org.springframework.validation.ValidationUtils; import org.springframework.validation.Validator; public class UserValidator implements Validator { - private Pattern pattern; - private Matcher matcher; - private static final String EMAIL_PATTERN = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@" + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"; @Override public boolean supports(Class clazz) { @@ -24,10 +20,4 @@ public class UserValidator implements Validator { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "username", "message.username", "UserName is required."); } - public boolean validateEmail(String email) { - pattern = Pattern.compile(EMAIL_PATTERN); - matcher = pattern.matcher(email); - return matcher.matches(); - - } } diff --git a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/ValidEmail.java b/spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/ValidEmail.java similarity index 94% rename from spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/ValidEmail.java rename to spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/ValidEmail.java index 3ad5558df2..df852351c3 100644 --- a/spring-security-login-error-handling/src/main/java/org/baeldung/persistence/service/ValidEmail.java +++ b/spring-security-login-error-handling/src/main/java/org/baeldung/validation/service/ValidEmail.java @@ -1,4 +1,4 @@ -package org.baeldung.persistence.service; +package org.baeldung.validation.service; import javax.validation.Constraint; import javax.validation.Payload; diff --git a/spring-security-login-error-handling/src/main/java/org/baeldung/web/controller/RegistrationController.java b/spring-security-login-error-handling/src/main/java/org/baeldung/web/controller/RegistrationController.java index 73732c7a2c..c91fcae56d 100644 --- a/spring-security-login-error-handling/src/main/java/org/baeldung/web/controller/RegistrationController.java +++ b/spring-security-login-error-handling/src/main/java/org/baeldung/web/controller/RegistrationController.java @@ -3,13 +3,12 @@ package org.baeldung.web.controller; import javax.validation.Valid; import org.baeldung.persistence.model.User; -import org.baeldung.persistence.service.EmailExistsException; import org.baeldung.persistence.service.UserDto; import org.baeldung.persistence.service.IUserService; +import org.baeldung.validation.service.EmailExistsException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.MessageSource; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; @@ -25,8 +24,6 @@ public class RegistrationController { private final Logger LOGGER = LoggerFactory.getLogger(getClass()); private IUserService service; - @Autowired - private MessageSource messages; @Autowired public RegistrationController(IUserService service) { @@ -42,34 +39,27 @@ public class RegistrationController { } @RequestMapping(value = "/user/registration", method = RequestMethod.POST) - public ModelAndView registerUserAccount(@ModelAttribute("user") @Valid UserDto userAccountData, BindingResult result, WebRequest request, Errors errors) { + public ModelAndView registerUserAccount(@ModelAttribute("user") @Valid UserDto accountDto, BindingResult result, WebRequest request, Errors errors) { User registered = new User(); if (!result.hasErrors()) - registered = createUserAccount(userAccountData, result); + registered = createUserAccount(accountDto, result); if (registered == null) { result.rejectValue("email", "message.regError"); } if (result.hasErrors()) { - return new ModelAndView("registration", "user", userAccountData); + return new ModelAndView("registration", "user", accountDto); } else { - // Will show the success registration page--ORIGINAL - return new ModelAndView("successRegister", "user", userAccountData); - // Will redirect to login view (not in url as login.html) and user model can be accessed - // return new ModelAndView("login","user", userAccountData); - - - // Will redirect to login html but no model object---we send a success param to the login form - //return new ModelAndView("redirect:/login.html?success=true", "", null); + return new ModelAndView("successRegister", "user", accountDto); } } - private User createUserAccount(UserDto userAccountData, BindingResult result) { + private User createUserAccount(UserDto accountDto, BindingResult result) { User registered = null; try { - registered = service.registerNewUserAccount(userAccountData); + registered = service.registerNewUserAccount(accountDto); } catch (EmailExistsException e) { return null; } diff --git a/spring-security-login-error-handling/src/main/resources/application.properties b/spring-security-login-error-handling/src/main/resources/application.properties index 1144b5f03f..70a8ae5daa 100644 --- a/spring-security-login-error-handling/src/main/resources/application.properties +++ b/spring-security-login-error-handling/src/main/resources/application.properties @@ -1,10 +1,10 @@ ################### DataSource Configuration ########################## jdbc.driverClassName=com.mysql.jdbc.Driver -jdbc.url=jdbc:mysql://localhost:3306/spring_hibernate4_02?createDatabaseIfNotExist=true +jdbc.url=jdbc:mysql://localhost:3306/AUTHDATA jdbc.user=tutorialuser jdbc.pass=tutorialmy5ql init-db=false ################### Hibernate Configuration ########################## hibernate.dialect=org.hibernate.dialect.MySQLDialect -hibernate.show_sql=false -hibernate.hbm2ddl.auto=create-drop +hibernate.show_sql=true +hibernate.hbm2ddl.auto=validate diff --git a/spring-security-login-error-handling/src/main/resources/messages_en.properties b/spring-security-login-error-handling/src/main/resources/messages_en.properties index b8ec5102fa..de1d25c84c 100644 --- a/spring-security-login-error-handling/src/main/resources/messages_en.properties +++ b/spring-security-login-error-handling/src/main/resources/messages_en.properties @@ -25,6 +25,13 @@ label.form.loginPass=Password label.form.loginEnglish=English label.form.loginSpanish=Spanish label.form.loginSignUp=Sign up +label.pages.logout=Logout +label.pages.admin=Administrator +label.pages.home.title=Home +label.pages.home.message=Welcome Home +label.pages.admin.message=Welcome Admin +label.pages.user.message=Welcome User +label.successRegister.title=Registration Success ValidEmail.user.email=Invalid email address! UniqueUsername.user.username=An account with that username/email already exists NotNull.user.firstName=First name required diff --git a/spring-security-login-error-handling/src/main/resources/messages_es_ES.properties b/spring-security-login-error-handling/src/main/resources/messages_es_ES.properties index c28ee68c24..f3fdb63304 100644 --- a/spring-security-login-error-handling/src/main/resources/messages_es_ES.properties +++ b/spring-security-login-error-handling/src/main/resources/messages_es_ES.properties @@ -25,6 +25,13 @@ label.form.loginPass=Contrasenia label.form.loginEnglish=Ingles label.form.loginSpanish=Espaniol label.form.loginSignUp=Registrese +label.pages.logout=Salir +label.pages.admin=Administrador +label.pages.home.title=Inicio +label.pages.home.message=Bienveni@ a Casa +label.pages.admin.message=Bienvenido Admin +label.pages.user.message=Bienvenido Usuario +label.successRegister.title=Registro Exitoso ValidEmail.user.email=Cuenta correo invlida! UniqueUsername.user.username=Ya existe una cuenta con ese nombre de usuario NotNull.user.firstName=Por favor ingrese su nombre diff --git a/spring-security-login-error-handling/src/main/resources/webSecurityConfig.xml b/spring-security-login-error-handling/src/main/resources/webSecurityConfig.xml index f02290fc2c..d584ff342f 100644 --- a/spring-security-login-error-handling/src/main/resources/webSecurityConfig.xml +++ b/spring-security-login-error-handling/src/main/resources/webSecurityConfig.xml @@ -4,7 +4,7 @@ xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation=" http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd"> + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd"> diff --git a/spring-security-login-error-handling/src/main/webapp/WEB-INF/mvc-servlet.xml b/spring-security-login-error-handling/src/main/webapp/WEB-INF/mvc-servlet.xml index 8b81b56aa4..94bd63e068 100644 --- a/spring-security-login-error-handling/src/main/webapp/WEB-INF/mvc-servlet.xml +++ b/spring-security-login-error-handling/src/main/webapp/WEB-INF/mvc-servlet.xml @@ -2,6 +2,6 @@ + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd"> \ No newline at end of file diff --git a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/admin.jsp b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/admin.jsp index 3b88dbdb12..574f84453e 100644 --- a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/admin.jsp +++ b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/admin.jsp @@ -8,14 +8,21 @@ " rel="stylesheet"> - - - - -

Hello Admin

-
- - ">Logout - ">Home +
+
+ + + + +

+ +

+
+ "> "> +
+
diff --git a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/console.jsp b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/console.jsp index f6ab8b6121..da04eac57d 100644 --- a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/console.jsp +++ b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/console.jsp @@ -1,22 +1,29 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%> +<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%> " rel="stylesheet"> -

This is the landing page for the admin

- +
+
+

This is the landing page for the admin

+ This text is only visible to a user
-
- + + This text is only visible to an admin
-
- ">Logout - ">Administrator Page + + "> "> +
+
\ No newline at end of file diff --git a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/home.jsp b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/home.jsp index 79461bef1d..68819f09f4 100644 --- a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/home.jsp +++ b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/home.jsp @@ -1,13 +1,22 @@ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ page session="true"%> +<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%> " rel="stylesheet"> -Home +<spring:message code="label.pages.home.title"></spring:message> -

Welcome back home!

+
+
+

+ +

+ "> +
+
diff --git a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/homepage.jsp b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/homepage.jsp index 4fb2853ef1..c24fee9876 100644 --- a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/homepage.jsp +++ b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/homepage.jsp @@ -1,25 +1,31 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> -<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%> +<%@ taglib prefix="sec" + uri="http://www.springframework.org/security/tags"%> +<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%> <%@ page session="true"%> " rel="stylesheet"> -

This is the homepage for the user

+
+
+ + +
+
- - This text is only visible to a user -
-
- - - This text is only visible to an admin -
-
- - ">Logout - ">Home - ">Administrator Page + + +
+
+ "> "> "> +
+
\ No newline at end of file diff --git a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/invalidSession.jsp b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/invalidSession.jsp index 59e9cdc22b..4e62083a52 100644 --- a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/invalidSession.jsp +++ b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/invalidSession.jsp @@ -3,12 +3,18 @@ " rel="stylesheet"> -Home +<spring:message code="label.pages.home.title"></spring:message> -

- -

+
+
+

+ +

+ "> +
+
diff --git a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/login.jsp b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/login.jsp index ea196f0114..98d983b211 100644 --- a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/login.jsp +++ b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/login.jsp @@ -1,5 +1,6 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> -<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%> +<%@ taglib prefix="sec" + uri="http://www.springframework.org/security/tags"%> <%@taglib uri="http://www.springframework.org/tags" prefix="spring"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> @@ -11,8 +12,12 @@ " rel="stylesheet"> -
- +
+
+
+ +
+
-

- | - -
- - - - - - - - - - - - -
/>
+
+
+

+ +

+ + | + + + + + + + + + + + + + +
/>
- -
Current Locale : ${pageContext.response.locale} -
- "> + +
Current Locale : ${pageContext.response.locale}
"> +
+
\ No newline at end of file diff --git a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/logout.jsp b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/logout.jsp index f33773b217..10cc4591b4 100644 --- a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/logout.jsp +++ b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/logout.jsp @@ -1,5 +1,6 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> -<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%> +<%@ taglib prefix="sec" + uri="http://www.springframework.org/security/tags"%> <%@taglib uri="http://www.springframework.org/tags" prefix="spring"%> @@ -15,12 +16,17 @@ - -
- +
+
+ +
+ +
+
+ "> +
- - Login \ No newline at end of file diff --git a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/registration.jsp b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/registration.jsp index 38eb4cf9eb..0d6781a5db 100644 --- a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/registration.jsp +++ b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/registration.jsp @@ -3,7 +3,8 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> -<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%> +<%@ taglib prefix="sec" + uri="http://www.springframework.org/security/tags"%> <%@ page session="false"%> @@ -11,40 +12,53 @@ <spring:message code="label.form.title"></spring:message> - -

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- "> +
+
+

+ +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+
"> +
+
\ No newline at end of file diff --git a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/successRegister.jsp b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/successRegister.jsp index d23a2e298f..883a5aad82 100644 --- a/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/successRegister.jsp +++ b/spring-security-login-error-handling/src/main/webapp/WEB-INF/view/successRegister.jsp @@ -1,5 +1,6 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> -<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%> +<%@ taglib prefix="sec" + uri="http://www.springframework.org/security/tags"%> <%@taglib uri="http://www.springframework.org/tags" prefix="spring"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> @@ -13,10 +14,14 @@ Registration Success -
- +
+
+
+ +
+ "> +
- "> - \ No newline at end of file diff --git a/spring-security-login-error-handling/src/main/webapp/resources/bootstrap.css b/spring-security-login-error-handling/src/main/webapp/resources/bootstrap.css index 5b7fe7e856..a5b7ccc211 100644 --- a/spring-security-login-error-handling/src/main/webapp/resources/bootstrap.css +++ b/spring-security-login-error-handling/src/main/webapp/resources/bootstrap.css @@ -1091,7 +1091,7 @@ input[type="tel"], input[type="color"], .uneditable-input { display: inline-block; - height: 20px; + height: 30px; padding: 4px 6px; margin-bottom: 10px; font-size: 14px;