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

📄 siteconfigaction.java

📁 EasyJF官网(www.easyjf.com)全站系统源码使用说明 全站源码是EasyJF开源团队站务组及核心成员共同开发及维护的系统
💻 JAVA
字号:
package com.easyjf.news.action;

import com.easyjf.news.business.ActiveUser;
import com.easyjf.news.business.SiteConfig;
import com.easyjf.news.business.SystemUtil;
import com.easyjf.util.CommUtil;
import com.easyjf.web.ActionContext;
import com.easyjf.web.Module;
import com.easyjf.web.Page;
import com.easyjf.web.WebForm;
import com.easyjf.web.tools.AbstractCmdAction;
import com.easyjf.web.tools.IActiveUser;

public class SiteConfigAction extends AbstractCmdAction {
	public Page doInit(WebForm form, Module module) {
		// TODO Auto-generated method stub
		return doShow(form,module);
	}

	public Page doShow(WebForm form, Module module) {		
		form.addPo(SystemUtil.getSiteConfig());
		return module.findPage(module.getDefaultPage());
	}
	public Page doSave(WebForm form, Module module) {
		String cid=CommUtil.null2String(form.get("cid"));
		SiteConfig obj=null;
		boolean op=false;
		if(cid.equals(""))
		{
			obj=(SiteConfig)form.toPo(SiteConfig.class);			
			op=obj.save();
		}
		else 
		{
			obj=SiteConfig.read(cid);
			form.toPo(obj);
			op=obj.update();
		}
		if(op)
		{
			form.addResult("msg","保存成功!");
			}
		else form.addResult("msg","保存失败!");
		return module.findPage(module.getDefaultPage());
	}
	public Object doBefore(WebForm form, Module module) {		
		ActiveUser u=(ActiveUser)this.getCurrentUser(form);
		if(u==null)return new Page("popedomError","/nologin.htm","page");		
		return null;
	}
	public IActiveUser getCurrentUser(WebForm form) {	
		return (IActiveUser)ActionContext.getContext().getSession().getAttribute("sysuser");
	}
}

⌨️ 快捷键说明

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