⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loginaction.java

📁 基于ssh2的三者整合
💻 JAVA
字号:
package com.lixineng.action;

import java.util.Map;


import com.lixineng.action.base.BaseAction;
import com.lixineng.service.AuctionService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;


   //public class LoginAction extends ActionSupport {
    public class LoginAction extends BaseAction {
	private String username;
	private String password;
	private String vercode;
//	private AuctionService aucService;
	
//	public void setAucService(AuctionService aucService) {
//		this.aucService = aucService;
//	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getVercode() {
		return vercode;
	}

	public void setVercode(String vercode) {
		this.vercode = vercode;
	}

	public String execute() throws Exception
	{  
		Map session = ActionContext.getContext().getSession();
		String ver2=(String) session.get("rand");
		session.put("rand", null);
	    if(getVercode().equalsIgnoreCase(ver2))
		{
			Integer userId=aucService.validLogin(getUsername(), getPassword());
			if(userId!=null)
			{
				session.put("userId", userId);
				return SUCCESS;
			}
			else
			{
			addActionError("用户名/密码不匹配");
				return "failure";
			}
			
			
		}
		else
		{
			addActionError("验证码不匹配,请重新输入");
			return "failure";
		}
		
	}

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -