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

📄 linktree.jsp

📁 Web开发的基本框架
💻 JSP
字号:
<%@ taglib uri="/tags/web-seltree" prefix="tree"%>
<%@ taglib uri="/tags/web-i18n" prefix="web"%>
<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="org.loushang.web.taglib.util.skin.SkinUtils"%>
<%@ page import="java.util.*"%>
<web:js src="XMLSelTree.js"/>
<link rel="stylesheet" type="text/css" href="<%=SkinUtils.getCSS(request,"XMLSelTree.css")%>">
<%
        ArrayList list = new ArrayList();		
		for (int i=1;i<=3;i++){
    		HashMap hash = new HashMap();		
    		hash.put("nodeId", String.valueOf(i));    		
    		hash.put("CheckData",String.valueOf(i));
    		    		
    		if (i==1){
    		    hash.put("title", "北京");
    		    hash.put("nodeXmlSrc", "");
    		    hash.put("toolTip", "提示:北京");
    		}
    		if (i==2){
    		    hash.put("title", "山东");
    		    hash.put("nodeXmlSrc", "");
    		    hash.put("toolTip", "提示:山东");
    		}
    		if (i==3){
    		    hash.put("title", "辽宁");
    		    hash.put("nodeXmlSrc", "");
    		    hash.put("toolTip", "提示:辽宁");
    		}     
    		list.add(hash);
		}
		request.setAttribute("tree",list);
%>
<html>
<head>
<title></title>
</head>
<table width="100%">
<tr>
<td><label class="title">linkTree 组件</label></td>
<% String file=request.getServletPath().substring(1);
   String app=request.getContextPath();
%>
<td><label class="title">url:<%=file%></label></td>
<td align="right" valign="bottom" nowrap>&nbsp;[<a href="<%=app%>/src.jsp?target=<%=file %>" target="source">源代码</a>]&nbsp;</td>
</tr>
</table>
<hr>
<BODY  topmargin="0" leftmargin="5" marginheight="0" marginwidth="0" bgcolor="#f2f8ff" text="#000000" >
<table width=100%  height=100%>
   <tr>
   <td width=20%>
	<tree:selTree treeName="seltree" containId="SrcDiv" isShowElseBranch="false" type="href" hasRoot="true" rootText="中国" style="width:180;height:100%;overflow:auto;white-space:nowrap;">
	  	<tree:selNode title="title" nodeId="nodeId" toolTip="toolTip" collection="tree" nodeXmlSrc="nodeXmlSrc"  caption="caption">
	    </tree:selNode>
	</tree:selTree>
	</td>
	<td width=40%>
	<span id="content"/>
	</td>
	</tr>
</table>
</tr>
</table>
</BODY>
<SCRIPT LANGUAGE="JavaScript">
seltree.clickImg=function(node){
  seltree.xmlsrc="getxml1.jsp?nodeId="+node.NodeId;  
  document.getElementById("content").innerHTML="您现在点击的节点 nodeId= "+node.NodeId+" title= "+node.title+"\n";
}
seltree.GoLink=function(p_sHref, p_sTarget)
{
	var sHref	= p_sHref;
	var sTarget	= p_sTarget;
	alert("href=\""+sHref+"\",target=\""+sTarget+"\"");
}
</SCRIPT>
</html>

⌨️ 快捷键说明

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