listurl.jsp

来自「jakarta-taglibs」· JSP 代码 · 共 48 行

JSP
48
字号
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<HTML>
<HEAD><TITLE>List by URL example</TITLE></HEAD>
<BODY>
<%@ taglib uri="http://jakarta.apache.org/taglibs/jndi-1.0" prefix="jndi" %>

<jndi:useContext 
    id='test'
    scope='session' 
    url='<%=request.getParameter("url")%>' 
/>

The Context is "<%=test.toString()%>"<BR/>

<table border="true">
<th>name</th><th>full name</th><th>class</th><th>toString of Object</th>
  <jndi:list 
    contextRef='test' 
    name='<%=request.getParameter("name")%>' 
    nameId="aName" 
    classId="aClass" 
    objId="anObj" 
    bindings="false"
  >
<%
    String nextContext, dn;
    if (anObj instanceof javax.naming.Context) {
        nextContext = ((javax.naming.Context)anObj).composeName(aName, request.getParameter("name"));
        dn = ((javax.naming.Context)anObj).getNameInNamespace();
    } else {
        nextContext=test.composeName(aName, request.getParameter("name"));
        dn = "N/A";
    }
%>
    <tr>
      <td><%=aName%><BR/>
          <A href='listurl.jsp?url=<%=request.getParameter("url")%>&name=<%=nextContext%>'>[list]</a> 
          <A href='lookupurl.jsp?url=<%=request.getParameter("url")%>&name=<%=nextContext%>'>[lookup] </a></td>
      <td><%=dn%></td>
      <td><%=aClass%></td>
      <td><%=anObj%></td>
    </tr>
  </jndi:list>
</table>
<form method="get" action="searchBySession.jsp"><B>Search this Context : </B><input type="text" name="filter" size="40" maxlength="256"></form>
</BODY>
</HTML>

⌨️ 快捷键说明

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