日期:2014-05-17 浏览次数:20649 次
@Component @Scope("prototype") @Namespace("/") public class UserAction extends BaseAction { /** * */ private static final long serialVersionUID = 1L; private static final Logger LOGGER = Logger.getLogger(UserAction.class); private String account; private String passwd; private String vcode; @Action(value = "/login", results = { @Result(name = "login", location = "login.jsp") }) public String login() { LOGGER.debug("Login"); return "login"; } @Action(value = "/doLogin") public void doLogin() { // TODO 这里需要操作数据库,暂时只是为了搭建框架使用 ProcessResult<JSON> processResult = new ProcessResult<JSON>(); String vcode = (String) session.getAttribute("VCODE"); if (!this.vcode.equals(vcode)) { processResult.setSuccess(false); processResult.setMessage("验证码错误!"); sendJson(processResult.toJSON()); return; } processResult.setSuccess(true); sendJson(processResult.toJSON()); return; }