📄 loginbankcontroller.java
字号:
package springexample.contoller;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;
import springexample.commands.AccountDetail;
import springexample.commands.LoginCommand;
import springexample.services.AccountServices;
import springexample.services.AuthenticationService;
/**
* @author naveenb
*/
public class LoginBankController extends SimpleFormController {
public LoginBankController(){
}
protected ModelAndView onSubmit(Object command) throws Exception{
LoginCommand loginCommand = (LoginCommand) command;
authenticationService.authenticate(loginCommand);
AccountDetail accountdetail = accountServices.getAccountSummary(loginCommand.getUserId());
return new ModelAndView(getSuccessView(),"accountdetail",accountdetail);
}
private AuthenticationService authenticationService;
private AccountServices accountServices;
/**
* @return Returns the accountServices.
*/
public AccountServices getAccountServices() {
return accountServices;
}
/**
* @param accountServices The accountServices to set.
*/
public void setAccountServices(AccountServices accountServices) {
this.accountServices = accountServices;
}
/**
* @return Returns the authenticationService.
*/
public AuthenticationService getAuthenticationService() {
return authenticationService;
}
/**
* @param authenticationService The authenticationService to set.
*/
public void setAuthenticationService(
AuthenticationService authenticationService) {
this.authenticationService = authenticationService;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -