easyui树形菜单学习第一步

1.action代码

/**
 * 
 */
package com.jit.z2206.sue.md5webproject.action;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.jit.z2206.sue.md5webproject.model.Menu;
import com.jit.z2206.sue.md5webproject.service.MenuService;
import com.opensymphony.xwork2.ActionSupport;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

/**
 * @author sue wong
 * 2017年7月26日上午9:15:46
 * since v1.0
 */
public class MenuAction extends ActionSupport{
	private JSONArray json;
	private MenuService menuservice;
	private Menu menu;
	private List list;
	private JSONObject obj;
	
	
	/**
	 * @return the obj
	 */
	public JSONObject getObj() {
		return obj;
	}


	/**
	 * @param obj the obj to set
	 */
	public void setObj(JSONObject obj) {
		this.obj = obj;
	}


	/**
	 * @return the menu
	 */
	public Menu getMenu() {
		return menu;
	}


	/**
	 * @param menu the menu to set
	 */
	public void setMenu(Menu menu) {
		this.menu = menu;
	}


	

	/**
	 * @return the json
	 */
	public JSONArray getJson() {
		return json;
	}


	/**
	 * @param json the json to set
	 */
	public void setJson(JSONArray json) {
		this.json = json;
	}


	/**
	 * @return the menuservice
	 */
	public MenuService getMenuservice() {
		return menuservice;
	}


	/**
	 * @param menuservice the menuservice to set
	 */
	public void setMenuservice(MenuService menuservice) {
		this.menuservice = menuservice;
	}


	public String execute()throws Exception{
		System.out.println("sssssssssssssssssssssssss");
		
		list=menuservice.findMenu(menu);
		
		json=JSONArray.fromObject(list);
		System.out.println(json);
		System.out.println("ssssssssssssss");
		/*Map map=new HashMap();
		map.put("total", json.size());
		map.put("rows",json);
		obj=JSONObject.fromObject(map);
		System.out.println(obj);*/
		return "success";
		
	}

}
2.Struts代码


		
			
				json
			
		
	

3.jsp代码




    
    
    
    
    
    
    jQuery EasyUI


    


Tree


    4.数据库
    easyui树形菜单学习第一步_第1张图片

    5.效果图

    easyui树形菜单学习第一步_第2张图片

    6.持续更新

    你可能感兴趣的:(jquery,easyui,前台,json)