myrightaction.java

来自「本系统基本完善了CRM管理系统的各个模块」· Java 代码 · 共 48 行

JAVA
48
字号
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.accp.struts.action;

import java.io.PrintWriter;

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

import net.sf.json.JSONSerializer;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import com.accp.service.RoleService;
import com.accp.util.RightList;

public class MyRightAction extends DispatchAction {
	private RoleService roleService = null;

	public RoleService getRoleService() {
		return roleService;
	}

	public void setRoleService(RoleService roleService) {
		this.roleService = roleService;
	}

	public ActionForward dofindRightName(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		System.out.println("查拥有的权限");
		PrintWriter out = response.getWriter();
		String roleId = request.getParameter("roleId");
		String type = request.getParameter("type");
		System.out.println("角色编号为:" + roleId);
		RightList rl1 = roleService.findRightByRoleId(Long.parseLong(roleId));
		// 转换成JSON数据
		String str1 = JSONSerializer.toJSON(rl1).toString();
		System.out.println(str1);
		out.print(str1);
		return null;
	}
}

⌨️ 快捷键说明

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