struts基于ModelDriven的表单数据接收

package com.test.action;

import com.opensymphony.xwork2.ModelDriven;
import com.test.dao.UserCheck;
import com.test.vo.User;

public class LoginAction implements ModelDriven<User>{
	
	public LoginAction()
	{
		System.out.println("ModelDriven驱动");
	}
	
	private User user=new User();
	
	public String execute()
	{
		
		
		/*调用业务逻辑层代码*/
		UserCheck check=new UserCheck();
		if(check.login(user))
		{
			return "login_ok";
		}
		else
		{
			return "login_fail";
		}
		
	}

	@Override
	public User getModel() {
		// TODO Auto-generated method stub
		return user;
	}
}

你可能感兴趣的:(struts基于ModelDriven的表单数据接收)