getxml.jsp

来自「Web开发的基本框架」· JSP 代码 · 共 68 行

JSP
68
字号
<%@ taglib uri="/tags/web-seltree" prefix="tree" %>
<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.util.*"%>
<%@ page import="org.loushang.web.taglib.util.*"%>
<%
        String nodeId = request.getParameter("nodeId");

        ArrayList list = new ArrayList();
        if (nodeId.equals("1")){
          HashMap hash = new HashMap();
          hash.put("nodeId", "11");
          hash.put("CheckData","11");          
          hash.put("title","北京市");
          list.add(hash);          
        }
        if (nodeId.equals("2")){
          HashMap hash = new HashMap();
          hash.put("nodeId", "21");         
          hash.put("nodeXmlSrc", "");              
          hash.put("title","济南");
          list.add(hash);
          hash = new HashMap();
          hash.put("nodeId", "22");
          hash.put("CheckData","22");
          hash.put("title","青岛");
          list.add(hash);
          hash = new HashMap();
          hash.put("nodeId", "23");
          hash.put("CheckData","23");
          hash.put("title","烟台");
          list.add(hash);
          hash = new HashMap();
          hash.put("nodeId", "24");
          hash.put("CheckData","24");
          hash.put("title","泰安");
          list.add(hash);
        }        
        if (nodeId.equals("21")){
          HashMap hash = new HashMap();
          hash.put("nodeId", "21");
          hash.put("CheckData","21");                
          hash.put("title","山大路");
          list.add(hash);
        }
        if (nodeId.equals("3")){
          HashMap hash = new HashMap();
          hash.put("nodeId", "31");	 
          hash.put("CheckData","31");
          hash.put("nodeXmlSrc", "");
          hash.put("title","大连");
          list.add(hash);
          hash = new HashMap();
          hash.put("nodeId", "32");
          hash.put("CheckData","32");
          hash.put("title","沈阳");
          list.add(hash);          
        }   
        if (nodeId.equals("31")){
          HashMap hash = new HashMap();
          hash.put("nodeId", "311");
          hash.put("CheckData","311");                
          hash.put("title","火炬路");
          list.add(hash);
        }    
        request.setAttribute("tree",list);
%>
<tree:selXmlNode title="$nodeId+title" nodeId="nodeId" collection="tree" nodeXmlSrc="nodeXmlSrc" checkData="CheckData" type="checkbox" isChecked="isChecked">
</tree:selXmlNode>

⌨️ 快捷键说明

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