@Controller @RequestMapping(value="/users") @SessionAttributes(value="user") public class MyAccountController extends Object
| Constructor and Description |
|---|
MyAccountController(UserService userService,
ConsoleService consoleService)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.web.servlet.ModelAndView |
changePassword(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Navigate to the change password page for a user (not an administrator)
|
org.springframework.web.servlet.ModelAndView |
forgotPassword()
Takes the user to the forgotPassword screen
|
org.springframework.web.servlet.ModelAndView |
myAccount(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.ModelMap model)
Navigate to the my account page for a user (not an administrator)
|
org.springframework.web.servlet.ModelAndView |
sendPassword(String username,
org.springframework.ui.ModelMap model)
Send the new Password to the user
TODO Split tasks into individual methods
|
org.springframework.web.servlet.ModelAndView |
userChangePassword(User user,
String confirmNewPassword,
org.springframework.ui.ModelMap model)
Accepts submission of the changePassword form
|
@Autowired public MyAccountController(UserService userService, ConsoleService consoleService)
userService - - The user service to useconsoleService - - The console service to use@RequestMapping(value="changePassword.htm",
method=GET)
public org.springframework.web.servlet.ModelAndView changePassword(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
request - - Standard HTTP Requestresponse - - Standard HTTP Response@RequestMapping(value="myAccount.htm",
method=GET)
public org.springframework.web.servlet.ModelAndView myAccount(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.ModelMap model)
request - - Standard HTTP Requestresponse - - Standard HTTP Response- The model, contains the user amongst other thingsmodel - - The model, will need to contain the user amongst other things@RequestMapping(value="userChangePassword.htm",
method=POST)
public org.springframework.web.servlet.ModelAndView userChangePassword(@ModelAttribute(value="user")
User user,
@RequestParam(required=false)
String confirmNewPassword,
org.springframework.ui.ModelMap model)
user - - The user we're changing the password forconfirmNewPassword - - The password again, for confirmationmodel - - The model to add any errors too if required@RequestMapping(value="forgotPassword.htm",
method=GET)
public org.springframework.web.servlet.ModelAndView forgotPassword()
@RequestMapping(value="sendPassword.htm",
method=POST)
public org.springframework.web.servlet.ModelAndView sendPassword(@RequestParam(required=false)
String username,
org.springframework.ui.ModelMap model)
username - - User to send the new password tomodel - - The model to hold errorsCopyright © 2007-2015 Ikasan. All Rights Reserved.