|
|
@ -27,10 +27,11 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.validation.BindingResult; |
|
|
|
import org.springframework.validation.BindingResult; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.WebDataBinder; |
|
|
|
import org.springframework.web.bind.WebDataBinder; |
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
import org.springframework.web.bind.annotation.InitBinder; |
|
|
|
import org.springframework.web.bind.annotation.InitBinder; |
|
|
|
import org.springframework.web.bind.annotation.ModelAttribute; |
|
|
|
import org.springframework.web.bind.annotation.ModelAttribute; |
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestMethod; |
|
|
|
|
|
|
|
import org.springframework.web.servlet.ModelAndView; |
|
|
|
import org.springframework.web.servlet.ModelAndView; |
|
|
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes; |
|
|
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes; |
|
|
|
|
|
|
|
|
|
|
@ -56,7 +57,7 @@ public class PasswordSettingsController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(method = RequestMethod.GET) |
|
|
|
@GetMapping |
|
|
|
protected ModelAndView displayForm(HttpServletRequest request) throws Exception { |
|
|
|
protected ModelAndView displayForm(HttpServletRequest request) throws Exception { |
|
|
|
PasswordSettingsCommand command = new PasswordSettingsCommand(); |
|
|
|
PasswordSettingsCommand command = new PasswordSettingsCommand(); |
|
|
|
User user = securityService.getCurrentUser(request); |
|
|
|
User user = securityService.getCurrentUser(request); |
|
|
@ -65,7 +66,7 @@ public class PasswordSettingsController { |
|
|
|
return new ModelAndView("passwordSettings","command",command); |
|
|
|
return new ModelAndView("passwordSettings","command",command); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(method = RequestMethod.POST) |
|
|
|
@PostMapping |
|
|
|
protected String doSubmitAction(@ModelAttribute("command") @Validated PasswordSettingsCommand command, BindingResult bindingResult, RedirectAttributes redirectAttributes) throws Exception { |
|
|
|
protected String doSubmitAction(@ModelAttribute("command") @Validated PasswordSettingsCommand command, BindingResult bindingResult, RedirectAttributes redirectAttributes) throws Exception { |
|
|
|
if (!bindingResult.hasErrors()) { |
|
|
|
if (!bindingResult.hasErrors()) { |
|
|
|
User user = securityService.getUserByName(command.getUsername()); |
|
|
|
User user = securityService.getUserByName(command.getUsername()); |
|
|
|