📄 filtaction.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 + -