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

📄 filtaction.java

📁 EasyJF开源新闻系统是一个由EasyJF开源团队组织开发的基于Java平台的开源新闻系统。当前系统已经实现了基本的基本的新闻的发布、审核、推荐
💻 JAVA
字号:
/**
 * 版权声明  EasyJF, 版权所有 违者必究
 * 版本号  0.1
 *创建者:张钰
 * 时 间:2006-4-6
 * 描 述:创建
 */
package com.easyjf.news.action;

import com.easyjf.news.logic.impl.FiltServiceImpl;
import com.easyjf.news.model.Constants;
import com.easyjf.news.model.Filter;
import com.easyjf.news.model.User;
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;

public class FiltAction extends AbstractCmdAction {
	User user = (User) ActionContext.getContext().getSession().getAttribute(
			Constants.SESSION_USER);

	Integer popedom;

	FiltServiceImpl filtdao = FiltServiceImpl.getInstance();

	public Page doInit(WebForm form, Module module) {
		// TODO Auto-generated method stub
		if (user != null) {
			popedom = user.getPopedom();
			if (popedom == 3) {
				return new Page("filt", "/filter.html");
			} else {
				return new Page("login", "/userLogin.html");
			}
		} else {
			return new Page("login", "/userLogin.html");
		}

	}

	public Page doSave(WebForm form, Module module) {
		if (user != null) {
			popedom = user.getPopedom();
			if (popedom == 3) {
				Filter filter = (Filter) form.toPo(Filter.class);
				if (filtdao.saveFilt(filter)) {
					form.addResult("msg", "添加成功!");
					return new Page("filter", "/filter.html");
				} else {
					return new Page("filter", "/filter.html");
				}
			} else {
				return new Page("noright", "/noright.html");
			}

		} else {
			return new Page("login", "/userLogin.html");
		}
	}

}

⌨️ 快捷键说明

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