loginbankcontroller.java
来自「白广元写的java web整合开发完全自学手册的源代码」· Java 代码 · 共 60 行
JAVA
60 行
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 + =
减小字号Ctrl + -
显示快捷键?