IBM®
跳转到主要内容
    中国 [选择]    使用条款
 
 
Select a scope:Search for:    
    首页    产品    服务与解决方案     支持与下载    个性化服务    
跳转到主要内容

developerWorks 中国  >  Web development | Java technology  >

Spring 系列,第 3 部分: 进入 Spring MVC

用 Spring MVC 轻松进行应用程序开发

developerWorks

返回文章

在打印这一页时,请选择 landscape 布局选项。


清单 4. LoginBankController 扩展 SimpleFormController
				      
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;
   public AccountServices getAccountServices() {
      return accountServices;
   }
   public void setAccountServices(AccountServices accountServices) {
      this.accountServices = accountServices;
   }
   public AuthenticationService getAuthenticationService() {
      return authenticationService;
   }
   public void setAuthenticationService(
         AuthenticationService authenticationService) {
      this.authenticationService = authenticationService;
   }
}
	

返回文章

    关于 IBM 隐私条约 联系 IBM 使用条款