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

📄 rolejsp.java

📁 野蔷薇论坛源码 java 自己看看吧。 学习用
💻 JAVA
字号:
/* 
 * Created on 2007-2-22
 * Last modified on 2007-3-6
 * Powered by YeQiangWei.com
 */
package com.yeqiangwei.club.view.jsp;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.yeqiangwei.club.param.RoleParameter;
import com.yeqiangwei.club.service.ServiceLocator;
import com.yeqiangwei.club.service.ServiceWrapper;
import com.yeqiangwei.club.service.model.RoleModel;
import com.yeqiangwei.club.service.security.RoleService;
import com.yeqiangwei.club.util.BeanLocator;
import com.yeqiangwei.club.util.BeanUtils;
import com.yeqiangwei.util.Validator;
import com.yeqiangwei.club.controller.form.RoleForm;
import com.yeqiangwei.club.view.model.RoleView;
import com.yeqiangwei.util.ParamUtils;

public class RoleJsp extends BaseJsp{
	
	private RoleService roleService;

	public RoleJsp(HttpServletRequest request, HttpServletResponse response) {
		super(request, response);
	}
	
	public RoleForm getRoleForm(){
		int roleId = ParamUtils.getIntParameter(request,"roleId");
		RoleForm f = (RoleForm) ParamUtils.getAttribute(request,"RoleForm");
		if(Validator.isEmpty(f)){
			f = new RoleForm();
			RoleModel model = this.getRoleService().findById(roleId);
			if(!Validator.isEmpty(model)){
				BeanUtils.copyProperties(f,model);
			}
		}
		return f;
	}

	public RoleService getRoleService() {
		if(Validator.isEmpty(roleService)){
			roleService = (RoleService) ServiceWrapper.getSingletonInstance(ServiceLocator.ROLE);
		}
		return roleService;
	}
	
	@SuppressWarnings("unchecked")
	public List<RoleView> findAll(){
		RoleParameter param = new RoleParameter();
		List list = this.getRoleService().findByParameter(param);
		BeanUtils.copyListProperties(list,BeanLocator.ROLEVIEW);
		return list;
	}
	
	
	@SuppressWarnings("unchecked")
	public List<RoleView> findByForumId(int forumId){
		RoleParameter param = new RoleParameter();
		param.setForumId(forumId);
		List list = this.getRoleService().findByParameter(param);
		BeanUtils.copyListProperties(list,BeanLocator.ROLEVIEW);
		return list;
	}
	
	public String getBrowsePower(String str, int locator) {
		return this.getRoleService().getBrowsePower(str,locator);
	}

	public String getOperatePower(String str, int locator) {
		return this.getRoleService().getOperatePower(str,locator);
	}

	public String getAdminPower(String str, int locator) {
		return this.getRoleService().getAdminPower(str,locator);
	}
	
	
}

⌨️ 快捷键说明

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