?? sign.java
字號:
package com.laoer.bbscs.web.action;
import com.laoer.bbscs.web.form.*;
import com.laoer.bbscs.web.servlet.*;
import com.laoer.bbscs.bean.*;
import com.laoer.bbscs.sys.*;
import org.apache.struts.action.*;
import javax.servlet.http.*;
/**
* <p>Title: TianYi BBS</p>
* <p>Description: TianYi BBS System</p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: LAOER.COM/TIANYISOFT.NET</p>
* @author laoer
* @version 6.0
*/
public class Sign
extends BaseAction {
public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) {
ActionErrors errors = new ActionErrors();
SignForm form = (SignForm) actionForm;
UserCheck uc = this.getUserCheck(httpServletRequest, httpServletResponse,
Constant.MESSAGE.getMessage(
httpServletRequest.getLocale(),
"place.sign"));
if (uc.isGuest()) {
errors.add("error.pleaselogin", new ActionError("error.pleaselogin"));
saveErrors(httpServletRequest, errors);
LoginForm loginForm = new LoginForm();
loginForm.setTourl(SysUtil.getToURL(httpServletRequest,
"sign" + Constant.FILEPREFIX));
/*
loginForm.setTourl(SysUtil.encodeURL("sign" + Constant.FILEPREFIX,
Constant.CHARSET));*/
httpServletRequest.setAttribute("loginForm", loginForm);
//return actionMapping.findForward("login");
return SysUtil.getPassLogin(actionMapping);
}
if (form.getAction().equals("show")) {
//UserInfo ui = this.getUserInfoService().findUserInfoById(new Long(uc.getId()));
UserInfo ui = this.getUserCache().getUserInfoFromCache(uc.getId());
if (ui == null) {
errors.add("error.getusererror", new ActionError("error.getusererror"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
}
form.setAction("signdo");
form.setSign_detail1(ui.getSignDetail1());
form.setSign_detail2(ui.getSignDetail2());
form.setSign_detail3(ui.getSignDetail3());
form.setSign_name1(ui.getSignName1());
form.setSign_name2(ui.getSignName2());
form.setSign_name3(ui.getSignName3());
httpServletRequest.setAttribute("signForm", form);
return actionMapping.findForward("sign");
}
if (form.getAction().equals("signdo")) {
//UserInfo ui = this.getUserInfoService().findUserInfoById(new Long(uc.getId()));
UserInfo ui = this.getUserCache().getUserInfoFromCache(uc.getId());
if (ui == null) {
errors.add("error.getusererror", new ActionError("error.getusererror"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
}
ui.setSignName1(form.getSign_name1());
ui.setSignName2(form.getSign_name2());
ui.setSignName3(form.getSign_name3());
ui.setSignDetail1(SysUtil.scriptEncode(form.getSign_detail1()));
ui.setSignDetail2(SysUtil.scriptEncode(form.getSign_detail2()));
ui.setSignDetail3(SysUtil.scriptEncode(form.getSign_detail3()));
this.getUserInfoService().saveUserInfo(ui);
this.getUserInfoService().createUserSignFile(ui);
this.getUserCache().putUserInfoInCache(ui);
ActionForward f = new ActionForward(SysUtil.getResultUrl(
"succeed.setusersign", ""), true);
return f;
}
return actionMapping.findForward("error");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -