json-lib-2.2.3-jdk15.jar+所需jar包

做项目,用到了json-lib-2.2.3-jdk15.jar,使用时提示如下错误:

 root cause
java.lang.ClassNotFoundException: net.sf.ezmorph.Morpher

 

原因:使用json-lib-2.2.3-jdk15.jar必要也要导入它的依赖包:

ezmorph-1.0.6.jar
commons-lang 2.4
commons-beanutils 1.7.0
commons-collections 3.2
commons-logging 1.1.1

 

我做项目用的地方,代码:

	/**
	 * 打开授权
	 */
	public String openImpower()
	{	
		role = service.queryById(roleNum);
		
		TRolePriv rp = new TRolePriv();
		rp.setRoleNum(roleNum);
		
		List<TRolePriv> rpList = service.queryRolePriv(rp);//权限中间表List
		List<TEmployeePriv> privList = service.queryAllPriv(new TEmployeePriv());//查询所有TEmployeePriv
		
		/**合成权限树*/
		List<PrivJSON> jsonList = new ArrayList<PrivJSON>();
		
		for( TEmployeePriv priv : privList ){
			if("60".equals(priv.getPrivType())){
				PrivJSON json = new PrivJSON();//一级菜单
				json.setId(priv.getPrivNum());
				json.setpId("0");
				json.setName(priv.getPrivName());
				json.setOpen(false);//默认不展开
				
				jsonList.add(json);
			}
			else{
				PrivJSON json2 = new PrivJSON();
				json2.setId(priv.getPrivNum());
				json2.setpId(priv.getMenuId1());
				json2.setName(priv.getPrivName());
				json2.setPrivNum(priv.getPrivNum());
				
				for(TRolePriv trp : rpList){
					if(trp.getPrivNum().equals(priv.getPrivNum())){
						json2.setOpen(false);//默认不展开
						json2.setChecked(true);
					}
				}
				jsonList.add(json2);
			}
		}
		
		JSONArray myjsonObj = JSONArray.fromObject(jsonList);//将权限集合,转成JSON数组
		this.getRequest().setAttribute("myjsonObj",myjsonObj);
		
		successPath = "/jsp/phone/priv/role/impowerRole.jsp";
		return SUCCESS;
	}

 

###附件是json-lib加依赖包

你可能感兴趣的:(json-lib)