📄 adminpostviewset.java
字号:
package com.laoer.bbscs.web.action;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import com.laoer.bbscs.service.config.*;
import com.laoer.bbscs.web.form.*;
import com.laoer.bbscs.exception.SysConfigException;
public class AdminPostViewSet
extends Action {
private SysConfig sysConfig;
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
AdminPostViewSetForm adminPostViewSetForm = (AdminPostViewSetForm) form;
if (adminPostViewSetForm.getAction().equalsIgnoreCase("index")) {
adminPostViewSetForm.setAction("save");
adminPostViewSetForm.setPostDefFaceImg(this.getSysConfig().getPostDefFaceImg());
adminPostViewSetForm.setPostPerPage(this.getSysConfig().getPostPerPage());
adminPostViewSetForm.setPostShowUserImg(this.getSysConfig().getPostShowUserImg());
adminPostViewSetForm.setPostVoteRec(this.getSysConfig().getPostVoteRec());
adminPostViewSetForm.setUserPerPage(this.getSysConfig().getUserPerPage());
return mapping.findForward("postViewSet");
}
if (adminPostViewSetForm.getAction().equalsIgnoreCase("save")) {
ActionMessages messages = new ActionMessages();
this.getSysConfig().setPostDefFaceImg(adminPostViewSetForm.getPostDefFaceImg());
this.getSysConfig().setPostPerPage(adminPostViewSetForm.getPostPerPage());
this.getSysConfig().setPostShowUserImg(adminPostViewSetForm.getPostShowUserImg());
this.getSysConfig().setPostVoteRec(adminPostViewSetForm.getPostVoteRec());
this.getSysConfig().setUserPerPage(adminPostViewSetForm.getUserPerPage());
try {
this.getSysConfig().saveConfigs();
messages.add("resultMsg", new ActionMessage("bbscs.dataupdate.succeed"));
this.saveMessages(request, messages);
}
catch (SysConfigException ex) {
messages.add("error.dataupdate.failed", new ActionMessage("error.dataupdate.failed"));
this.saveErrors(request, messages);
}
return mapping.findForward("postViewSet");
}
return mapping.getInputForward();
}
public SysConfig getSysConfig() {
return sysConfig;
}
public void setSysConfig(SysConfig sysConfig) {
this.sysConfig = sysConfig;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -