You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by gl...@apache.org on 2002/04/08 16:39:44 UTC
cvs commit: jakarta-taglibs/jndi/xml jndi.xml intro.xml
glenn 02/04/08 07:39:44
Modified: jndi build.xml
jndi/examples/web listinitfac.jsp listurl.jsp
lookupinitfac.jsp lookupurl.jsp
searchByInitFactory.jsp searchBySession.jsp
jndi/src/org/apache/taglibs/jndi ForEachAttributeTag.java
GetAttributeTag.java ListTag.java LookupTag.java
SearchTag.java UseContextTag.java
jndi/xml intro.xml
Added: jndi/xml jndi.xml
Log:
Migrate jndi taglib to common build and create fancy docs.
Update tags so that they work in containers that reuse tag instances.
Could still use more work documenting script variables and their properties.
Revision Changes Path
1.7 +18 -233 jakarta-taglibs/jndi/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-taglibs/jndi/build.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- build.xml 20 Oct 2001 16:03:27 -0000 1.6
+++ build.xml 8 Apr 2002 14:39:44 -0000 1.7
@@ -1,243 +1,28 @@
-<!-- ANT Build Script for the "jndi" Custom Tag Library -->
-<!-- $Id: build.xml,v 1.6 2001/10/20 16:03:27 glenn Exp $ -->
-<project name="jndi" default="main" basedir=".">
+<?xml version="1.0"?>
- <!-- ******************** Adjustable Properties *********************** -->
+<!-- Define and use the common.xml ant build file for building
+ your taglib -->
- <!--
+<!DOCTYPE project [
+ <!ENTITY common SYSTEM "file:../common.xml">
+]>
- The following property values should be examined and customized
- for each custom tag library subproject.
+<!-- Your main ant build declaration -->
- ant.home Home directory for the ANT build tool
- This is normally defaulted from the
- ANT_HOME environment variable in the
- build script.
+<project name="jndi" default="main">
- servlet.jar Pathname of the servlet API classes
- you are using to compile, such as the
- one that comes with Tomcat. This is
- normally defaulted from the SERVLET_JAR
- environment variable in the build script.
+ <property file="../build.properties"/>
+ <property name="disable.examples.html" value="true"/>
+ <property name="checkRequirements.pre" value="checkRequirements.pre"/>
- taglib.name Base name of this tag library subproject.
-
- -->
-
- <property name="taglib.name" value="jndi"/>
- <!-- but the jar will be jndi-taglib so not to collide with the JNDI RI jars -->
- <property name="ant.home" value="../../jakarta-ant"/>
- <property name="servlet.jar" value="../../jakarta-servletapi/lib/servlet.jar"/>
-
-
- <!-- ****************** Project Standard Properties ******************* -->
-
- <!--
-
- The following property values reflect the standard directory
- organization for the jakarta-taglibs project, and should not
- be changed or overridden.
-
- build.dir Base directory for build targets
- dist.dir Base directory for distribution targets
- taglibs.xsl Taglibs stylesheet
-
- -->
-
- <property name="build.dir" value="../build"/>
- <property name="dist.dir" value="../dist"/>
- <property name="taglibs.xsl" value="../src/doc/stylesheets/taglibs.xsl"/>
-
- <!-- *********************** Default Properties ********************** -->
-
- <!--
-
- The following property values reflect the recommended directory
- structure for each custom tag library subproject. You should only
- need to adjust or override them if you use a different organization.
-
- conf.src Library configuration source directory
- doc.src Documentation app source directory
- examples.src Examples app source directory
- library.src Library Java source directory
-
- -->
-
- <property name="conf.src" value="conf"/>
- <property name="doc.src" value="doc"/>
- <property name="examples.src" value="examples"/>
- <property name="library.src" value="src"/>
- <property name="lib.src" value="lib"/>
-
-
- <!-- ********************* Derived Properties ************************* -->
-
- <!--
-
- These property values are derived from the previously defined values,
- and should not normally be overridden from the command line.
-
- build.doc Target directory for documentation app
- build.examples Target directory for examples app
- build.library Target directory for tag library
- dist.doc Destination WAR for documentation app
- dist.examples Destination WAR for examples app
- dist.library Destination JAR for tag library
- dist.tld Destination TLD file for tag library
-
- -->
-
- <property name="build.doc" value="${build.dir}/${taglib.name}/${taglib.name}-doc"/>
- <property name="build.examples" value="${build.dir}/${taglib.name}/${taglib.name}-examples"/>
- <property name="build.library" value="${build.dir}/${taglib.name}/${taglib.name}"/>
- <property name="dist.doc" value="${dist.dir}/${taglib.name}/${taglib.name}-doc.war"/>
- <property name="dist.examples" value="${dist.dir}/${taglib.name}/${taglib.name}-examples.war"/>
- <property name="dist.library" value="${dist.dir}/${taglib.name}/${taglib.name}-taglib.jar"/>
- <property name="dist.tld" value="${dist.dir}/${taglib.name}/${taglib.name}.tld"/>
- <property name="taglibs.doc" value="${dist.dir}/doc/doc/${taglib.name}-doc"/>
-
-
- <!-- ********************** Destination Preparation ********************* -->
-
- <target name="prepare">
- <!-- Set up build directories -->
- <mkdir dir="${build.dir}"/>
- <mkdir dir="${build.doc}"/>
- <mkdir dir="${build.doc}/javadoc"/>
- <mkdir dir="${build.doc}/WEB-INF"/>
- <mkdir dir="${build.doc}/WEB-INF/classes"/>
- <mkdir dir="${build.doc}/WEB-INF/lib"/>
- <mkdir dir="${build.examples}"/>
- <mkdir dir="${build.examples}/WEB-INF"/>
- <mkdir dir="${build.examples}/WEB-INF/classes"/>
- <mkdir dir="${build.examples}/WEB-INF/lib"/>
- <mkdir dir="${build.library}"/>
- <mkdir dir="${build.library}/META-INF"/>
- <!-- Set up distribution directory -->
- <mkdir dir="${dist.dir}"/>
- <mkdir dir="${dist.dir}/${taglib.name}"/>
- </target>
-
-
- <!-- **************** Compile Tag Library Components ******************** -->
-
- <!-- Compile the documentation application -->
- <target name="documentation" depends="prepare">
- <copy todir="${build.doc}/WEB-INF" >
- <fileset dir="${doc.src}/conf" />
- </copy>
- <!-- intro.xml isn't part of the documentation application,
- this is just a handy place to build it for the web site. -->
- <style in="xml/intro.xml"
- destdir="${build.doc}"
- out="${build.doc}/intro.html"
- style="${taglibs.xsl}">
- <param name="prefix" expression="../../"/>
- </style>
- <copy todir="${build.doc}">
- <fileset dir="${doc.src}/web">
- <include name="**/*.html"/>
- </fileset>
- </copy>
- <javadoc packagenames="org.apache.taglibs.jndi.*"
- classpath="${servlet.jar}"
- sourcepath="src"
- destdir="${build.doc}/javadoc"
- author="true"
- version="true"
- use="true"
- windowtitle="Jakarta JNDI custom tag library API"
- doctitle="Jakarta JNDI custom tag library"
- bottom="Copyright © 2000 Apache Software Foundation. All Rights Reserved."
- />
-<!--
- <javac srcdir="${doc.src}/src" destdir="${build.doc}/WEB-INF/classes"
- classpath="${servlet.jar}" debug="on"/>
--->
- </target>
-
- <!-- Compile the examples application -->
- <target name="examples" depends="library-dist">
-<!--
- <copydir src="${lib.src}" dest="${build.examples}/WEB-INF/lib"/>
- <copydir src="${library.src}" dest="${build.examples}/WEB-INF/classes"/>
--->
- <copy todir="${build.examples}/WEB-INF">
- <fileset dir="${examples.src}/conf" />
- </copy>
- <copy todir="${build.examples}" >
- <fileset dir="${examples.src}/web" />
- </copy>
- <copy file="${dist.tld}"
- tofile="${build.examples}/WEB-INF/${taglib.name}.tld"/>
- <copy file="${dist.library}"
- tofile="${build.examples}/WEB-INF/lib/${taglib.name}-taglib.jar"/>
- <copy file="${examples.src}/web/listinitfac.jsp"
- tofile="${build.examples}/listinitfac.txt"/>
- <copy file="${examples.src}/web/listurl.jsp"
- tofile="${build.examples}/listurl.txt"/>
- <copy file="${examples.src}/web/lookupinitfac.jsp"
- tofile="${build.examples}/lookupinitfac.txt"/>
- <copy file="${examples.src}/web/listurl.jsp"
- tofile="${build.examples}/listurl.txt"/>
- <copy file="${examples.src}/web/searchByInitFactory.jsp"
- tofile="${build.examples}/searchByInitFactory.txt"/>
- <copy file="${examples.src}/web/searchBySession.jsp"
- tofile="${build.examples}/searchBySession.txt"/>
-<!--
- <javac srcdir="${examples.src}/src"
- destdir="${build.examples}/WEB-INF/classes"
- classpath="${servlet.jar}" debug="on"/>
--->
- </target>
-
- <!-- Compile the tag library itself -->
- <target name="library" depends="prepare">
- <copy file="${conf.src}/jndi.tld"
- tofile="${build.library}/META-INF/taglib.tld"/>
- <javac srcdir="${library.src}" destdir="${build.library}"
- classpath="${servlet.jar}" debug="on"/>
+ <target name="checkRequirements.pre">
+ <antcall target="checkRequiredClass">
+ <param name="class" value="javax.naming.Context"/>
+ <param name="fail.message" value="The JNDI API is required to build the JNDI custom tag library. Please install the JNDI jar file in $JAVA_HOME/jre/lib/ext directory."/>
+ </antcall>
</target>
- <!-- Compile the library as well as the associated applications -->
- <target name="main" depends="library,documentation,examples"/>
-
-
- <!-- ******************* Create Distribution Files ********************** -->
-
- <!-- Create the documentation application WAR file -->
- <target name="documentation-dist" depends="documentation">
- <jar jarfile="${dist.doc}" basedir="${build.doc}" excludes="intro.html"/>
- <mkdir dir="${taglibs.doc}"/>
- <copy todir="${taglibs.doc}">
- <fileset dir="${build.doc}">
- <exclude name="WEB-INF/**"/>
- </fileset>
- </copy>
- </target>
-
- <!-- Create the examples application WAR file -->
- <target name="examples-dist" depends="examples">
- <jar jarfile="${dist.examples}" basedir="${build.examples}"/>
- </target>
-
- <!-- Create the library distribution files -->
- <target name="library-dist" depends="library">
- <jar jarfile="${dist.library}" basedir="${build.library}"/>
- <copy file="${conf.src}/${taglib.name}.tld" tofile="${dist.tld}"/>
- </target>
-
- <!-- Create the entire set of distribution files -->
- <target name="dist" depends="library-dist,examples-dist,documentation-dist"/>
-
-
-
- <!-- ************************ Utility Commands ************************** -->
-
- <!-- Delete output directories and files so we can build from scratch -->
- <target name="clean">
- <delete dir="${build.dir}/${taglib.name}"/>
- <delete dir="${dist.dir}/${taglib.name}"/>
- </target>
+ <!-- Include the common.xml ant build declarations -->
+ &common;
</project>
1.2 +6 -5 jakarta-taglibs/jndi/examples/web/listinitfac.jsp
Index: listinitfac.jsp
===================================================================
RCS file: /home/cvs/jakarta-taglibs/jndi/examples/web/listinitfac.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- listinitfac.jsp 12 Dec 2000 15:34:28 -0000 1.1
+++ listinitfac.jsp 8 Apr 2002 14:39:44 -0000 1.2
@@ -1,3 +1,4 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<HTML>
<HEAD><TITLE>List by Init Factory example</TITLE></HEAD>
<BODY>
@@ -10,7 +11,7 @@
providerUrl='<%=request.getParameter("provider")%>'
/>
-The Context is "<%=test.toString()%>"<BR>
+The Context is "<%=test.toString()%>"<BR/>
<table border="true">
<th>name</th><th>full name</th><th>class</th><th>toString of Object</th>
@@ -20,7 +21,7 @@
nameId="aName"
classId="aClass"
objId="anObj"
- bindings="true"
+ bindings="false"
>
<%
String nextContext, dn;
@@ -35,15 +36,15 @@
}
%>
<tr>
- <td><%=aName%><BR>
+ <td><%=aName%><BR/>
<A href='listinitfac.jsp?initfac=<%=request.getParameter("initfac")%>&provider=<%=request.getParameter("provider")%>&name=<%=nextContext%>'>[list]</a>
- <A href='lookupinitfac.jsp?initfac=<%=request.getParameter("initfac")%>&provider=<%=request.getParameter("provider")%>&name=<%=nextContext%>'>[lookup]</a></td>
+ <A href=lookupinitfac.jsp?initfac=<%=request.getParameter("initfac")%>&provider=<%=request.getParameter("provider")%>&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>
+<form method="get" action="searchBySession.jsp"><B>Search this Context : </B><input type="text" name="filter" size="40" maxlength="256"></form>
</BODY>
</HTML>
1.2 +6 -4 jakarta-taglibs/jndi/examples/web/listurl.jsp
Index: listurl.jsp
===================================================================
RCS file: /home/cvs/jakarta-taglibs/jndi/examples/web/listurl.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- listurl.jsp 12 Dec 2000 15:34:28 -0000 1.1
+++ listurl.jsp 8 Apr 2002 14:39:44 -0000 1.2
@@ -1,3 +1,4 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<HTML>
<HEAD><TITLE>List by URL example</TITLE></HEAD>
<BODY>
@@ -9,7 +10,7 @@
url='<%=request.getParameter("url")%>'
/>
-The Context is "<%=test.toString()%>"<BR>
+The Context is "<%=test.toString()%>"<BR/>
<table border="true">
<th>name</th><th>full name</th><th>class</th><th>toString of Object</th>
@@ -19,7 +20,7 @@
nameId="aName"
classId="aClass"
objId="anObj"
- bindings="<%=true%>"
+ bindings="false"
>
<%
String nextContext, dn;
@@ -32,7 +33,7 @@
}
%>
<tr>
- <td><%=aName%><BR>
+ <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>
@@ -41,5 +42,6 @@
</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>
+<form method="get" action="searchBySession.jsp"><B>Search this Context : </B><input type="text" name="filter" size="40" maxlength="256"></form>
+</BODY>
</HTML>
1.2 +2 -1 jakarta-taglibs/jndi/examples/web/lookupinitfac.jsp
Index: lookupinitfac.jsp
===================================================================
RCS file: /home/cvs/jakarta-taglibs/jndi/examples/web/lookupinitfac.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- lookupinitfac.jsp 12 Dec 2000 15:34:28 -0000 1.1
+++ lookupinitfac.jsp 8 Apr 2002 14:39:44 -0000 1.2
@@ -1,3 +1,4 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<HTML>
<HEAD><TITLE>Lookup by Init Factory example</TITLE></HEAD>
<BODY>
@@ -62,7 +63,7 @@
if (obj3 != null) {
%>
<jndi:forEachAttribute ref='obj3' id='attr'>
- <jndi:getAttribute ref='attr' id='val' multivalue='itterate'>
+ <jndi:getAttribute ref='attr' id='val' multivalue='iterate'>
<tr>
<td><jsp:getProperty name='attr' property='ID'/></td>
<td><%=val%></td>
1.2 +2 -1 jakarta-taglibs/jndi/examples/web/lookupurl.jsp
Index: lookupurl.jsp
===================================================================
RCS file: /home/cvs/jakarta-taglibs/jndi/examples/web/lookupurl.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- lookupurl.jsp 12 Dec 2000 15:34:28 -0000 1.1
+++ lookupurl.jsp 8 Apr 2002 14:39:44 -0000 1.2
@@ -1,3 +1,4 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<HTML>
<HEAD><TITLE>Lookup by URL example</TITLE></HEAD>
<BODY>
@@ -65,7 +66,7 @@
if (obj3 != null) {
%>
<jndi:forEachAttribute ref='obj3' id='attr'>
- <jndi:getAttribute ref='attr' id='val' multivalue='itterate'>
+ <jndi:getAttribute ref='attr' id='val' multivalue='iterate'>
<tr>
<td><jsp:getProperty name='attr' property='ID'/></td>
<td><%=val%></td>
1.2 +5 -4 jakarta-taglibs/jndi/examples/web/searchByInitFactory.jsp
Index: searchByInitFactory.jsp
===================================================================
RCS file: /home/cvs/jakarta-taglibs/jndi/examples/web/searchByInitFactory.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- searchByInitFactory.jsp 12 Dec 2000 15:34:28 -0000 1.1
+++ searchByInitFactory.jsp 8 Apr 2002 14:39:44 -0000 1.2
@@ -1,3 +1,4 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<HTML>
<HEAD><TITLE>Search by Init Factory Context</TITLE></HEAD>
<BODY>
@@ -11,7 +12,7 @@
/>
-The Context is "<%=test.toString()%>"<BR>
+The Context is "<%=test.toString()%>"<BR/>
The filter was "<%=request.getParameter("filter")%>"<br>
<table border="true">
@@ -23,12 +24,12 @@
name='<%=request.getParameter("name")%>'
id="result"
searchScope="SUBTREE_SCOPE"
- bindings='true'
+ bindings='false'
>
<tr>
<td><jsp:getProperty name="result" property="name" /></td>
<td><jsp:getProperty name="result" property="className" /></td>
- <td><jndi:getAttribute ref='result' attribute='objectclass' multivalue='separator'><BR></jndi:getAttribute></tf>
+ <td><jndi:getAttribute ref='result' attribute='objectclass' multivalue='separator'><BR/></jndi:getAttribute></tf>
</tr>
</jndi:search>
</table>
@@ -37,7 +38,7 @@
<table border>
<th>attribute name</th><th>AttributeValue</TH>
<jndi:forEachAttribute ref='result' id='attr'>
- <jndi:getAttribute ref='attr' id='val' multivalue='itterate'>
+ <jndi:getAttribute ref='attr' id='val' multivalue='iterate'>
<tr>
<td><jsp:getProperty name='attr' property='ID'/></td>
<td><%=val%></td>
1.2 +4 -3 jakarta-taglibs/jndi/examples/web/searchBySession.jsp
Index: searchBySession.jsp
===================================================================
RCS file: /home/cvs/jakarta-taglibs/jndi/examples/web/searchBySession.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- searchBySession.jsp 12 Dec 2000 15:34:28 -0000 1.1
+++ searchBySession.jsp 8 Apr 2002 14:39:44 -0000 1.2
@@ -1,3 +1,4 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<HTML>
<HEAD><TITLE>Search by Session Stored Context</TITLE></HEAD>
<BODY>
@@ -5,7 +6,7 @@
<jsp:useBean id="test" scope="session" type="javax.naming.Context" />
-The Context is "<%=test.lookup("")%>"<BR>
+The Context is "<%=test.lookup("")%>"<BR/>
The filter was "<%=request.getParameter("filter")%>"<br>
<table border="true">
@@ -16,7 +17,7 @@
filter='<%=request.getParameter("filter")%>'
name='<%=request.getParameter("name")%>'
id="result"
- bindings="<%=true%>"
+ bindings="false"
searchScope="SUBTREE_SCOPE"
>
<tr>
@@ -30,7 +31,7 @@
<table border>
<th>attribute name</th><th>AttributeValue</TH>
<jndi:forEachAttribute ref='result' id='attr'>
- <jndi:getAttribute ref='attr' id='val' multivalue='itterate'>
+ <jndi:getAttribute ref='attr' id='val' multivalue='iterate'>
<tr>
<td><jsp:getProperty name='attr' property='ID'/></td>
<td><%=val%></td>
1.2 +19 -49 jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/ForEachAttributeTag.java
Index: ForEachAttributeTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/ForEachAttributeTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ForEachAttributeTag.java 12 Dec 2000 15:34:30 -0000 1.1
+++ ForEachAttributeTag.java 8 Apr 2002 14:39:44 -0000 1.2
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/ForEachAttributeTag.java,v 1.1 2000/12/12 15:34:30 shemnon Exp $
- * $Revision: 1.1 $
- * $Date: 2000/12/12 15:34:30 $
+ * $Header: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/ForEachAttributeTag.java,v 1.2 2002/04/08 14:39:44 glenn Exp $
+ * $Revision: 1.2 $
+ * $Date: 2002/04/08 14:39:44 $
*
* ====================================================================
*
@@ -71,28 +71,21 @@
/**
*
* @author Danno Ferrin <sh...@earthlink.net>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class ForEachAttributeTag extends BodyTagSupport {
- protected Object attributeObject;
- protected NamingEnumeration nameEnum;
- protected Attribute currentAttribute;
- protected int scope;
+ private String attributeRef;
+ private Object attributeObject;
+ private NamingEnumeration nameEnum;
+ private Attribute currentAttribute;
+ private int scope = PageContext.PAGE_SCOPE;
/** Creates new ForEachAttributeTag */
public ForEachAttributeTag() {
}
/**
- * Getter for property scope
- * @return Value of property scope.
- */
- public String getScope() {
- return decodeScope(scope);
- }
-
- /**
* Setter for property scope.
* @param Scope New value of property scope.
*/
@@ -121,19 +114,16 @@
* @param ref New value of property ref.
*/
public void setRef(String ref) {
- attributeObject = pageContext.findAttribute(ref);
- }
-
- public void setPageContext(PageContext pc) {
- scope = PageContext.PAGE_SCOPE;
- nameEnum = null;
- currentAttribute = null;
- attributeObject = null;
-
- super.setPageContext(pc);
+ this.attributeRef = ref;
}
public int doStartTag() throws JspException {
+ // Initialize invocation variables
+ nameEnum = null;
+
+ if( attributeRef != null ) {
+ attributeObject = pageContext.findAttribute(attributeRef);
+ }
try {
if ((attributeObject instanceof DirContext)
&& (attributeObject != null)) {
@@ -151,9 +141,6 @@
nameEnum = ((Attributes)attributeObject).getAll();
}
} catch (NamingException ne) {
- //XXX todo determine log mechanism
-
- nameEnum = null;
}
if ((nameEnum != null) && nameEnum.hasMoreElements()) {
@@ -189,32 +176,15 @@
return EVAL_PAGE;
}
- public static String decodeScope(int scope) {
- switch (scope) {
- case PageContext.PAGE_SCOPE:
- return "page";
- case PageContext.REQUEST_SCOPE:
- return "request";
- case PageContext.SESSION_SCOPE:
- return "session";
- case PageContext.APPLICATION_SCOPE:
- return "application";
- default:
- return null;
- }
- }
-
public static int decodeScope(String scope) {
- if (scope.equalsIgnoreCase("page")) {
- return PageContext.PAGE_SCOPE;
- } else if (scope.equalsIgnoreCase("request")) {
+ if (scope.equalsIgnoreCase("request")) {
return PageContext.REQUEST_SCOPE;
} else if (scope.equalsIgnoreCase("session")) {
return PageContext.SESSION_SCOPE;
- } else if (scope.equalsIgnoreCase("applicaiton")) {
+ } else if (scope.equalsIgnoreCase("application")) {
return PageContext.APPLICATION_SCOPE;
} else {
- return -1;
+ return PageContext.PAGE_SCOPE;
}
}
}
1.3 +28 -58 jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/GetAttributeTag.java
Index: GetAttributeTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/GetAttributeTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- GetAttributeTag.java 6 Apr 2002 21:45:19 -0000 1.2
+++ GetAttributeTag.java 8 Apr 2002 14:39:44 -0000 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/GetAttributeTag.java,v 1.2 2002/04/06 21:45:19 glenn Exp $
- * $Revision: 1.2 $
- * $Date: 2002/04/06 21:45:19 $
+ * $Header: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/GetAttributeTag.java,v 1.3 2002/04/08 14:39:44 glenn Exp $
+ * $Revision: 1.3 $
+ * $Date: 2002/04/08 14:39:44 $
*
* ====================================================================
*
@@ -71,37 +71,30 @@
/**
*
* @author Danno Ferrin <sh...@earthlink.net>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class GetAttributeTag extends BodyTagSupport {
- protected Object attributeObject;
- protected int scope;
- protected String attribute;
- protected int multivalueMode;
- protected NamingEnumeration nameEnum;
- protected Attribute theAttribute;
+ private String attributeRef;
+ private Object attributeObject;
+ private int scope = PageContext.PAGE_SCOPE;
+ private String attribute;
+ private int multivalueMode = ONE_VALUE;;
+ private NamingEnumeration nameEnum;
+ private Attribute theAttribute;
/** Only take one value (first value if ordered) */
public static final int ONE_VALUE = 1;
/** Body provides a separator for the values */
public static final int SEPARATE_VALUES = 2;
- /** body should be itterated for each value */
- public static final int ITTERATE_VALUES = 3;
+ /** body should be iterated for each value */
+ public static final int ITERATE_VALUES = 3;
/** Creates new GetAttributeTag */
public GetAttributeTag() {
}
/**
- * Getter for property scope
- * @return Value of property scope.
- */
- public String getScope() {
- return decodeScope(scope);
- }
-
- /**
* Setter for property scope.
* @param Scope New value of property scope.
*/
@@ -130,7 +123,7 @@
* @param ref New value of property ref.
*/
public void setRef(String ref) {
- attributeObject = pageContext.findAttribute(ref);
+ attributeRef = ref;
}
/**
@@ -165,18 +158,15 @@
multivalueMode = decodeMultivalue(multivalue);
}
- public void setPageContext(PageContext pc) {
- scope = PageContext.PAGE_SCOPE;
- attribute = null;
- attributeObject = null;
- multivalueMode = ONE_VALUE;
+ public int doStartTag() throws JspException {
+ // Initialize invocation variables
nameEnum = null;
theAttribute = null;
-
- super.setPageContext(pc);
- }
-
- public int doStartTag() throws JspException {
+
+ if( attributeRef != null ) {
+ attributeObject = pageContext.findAttribute(attributeRef);
+ }
+
try {
if ((attributeObject instanceof DirContext)
&& (attributeObject != null)) {
@@ -202,9 +192,6 @@
theAttribute = (Attribute)attributeObject;
}
} catch (NamingException ne) {
- //XXX todo determine log mechanism
- attributeObject = null;
- theAttribute = null;
}
if (theAttribute == null) {
@@ -322,8 +309,8 @@
return "one";
case SEPARATE_VALUES:
return "separator";
- case ITTERATE_VALUES:
- return "itterate";
+ case ITERATE_VALUES:
+ return "iterate";
default:
return null;
}
@@ -334,39 +321,22 @@
return ONE_VALUE;
} else if (multivalue.equalsIgnoreCase("separator")) {
return SEPARATE_VALUES;
- } else if (multivalue.equalsIgnoreCase("itterate")) {
- return ITTERATE_VALUES;
+ } else if (multivalue.equalsIgnoreCase("iterate")) {
+ return ITERATE_VALUES;
} else {
return -1;
}
}
- public static String decodeScope(int scope) {
- switch (scope) {
- case PageContext.PAGE_SCOPE:
- return "page";
- case PageContext.REQUEST_SCOPE:
- return "request";
- case PageContext.SESSION_SCOPE:
- return "session";
- case PageContext.APPLICATION_SCOPE:
- return "application";
- default:
- return null;
- }
- }
-
public static int decodeScope(String scope) {
- if (scope.equalsIgnoreCase("page")) {
- return PageContext.PAGE_SCOPE;
- } else if (scope.equalsIgnoreCase("request")) {
+ if (scope.equalsIgnoreCase("request")) {
return PageContext.REQUEST_SCOPE;
} else if (scope.equalsIgnoreCase("session")) {
return PageContext.SESSION_SCOPE;
- } else if (scope.equalsIgnoreCase("applicaiton")) {
+ } else if (scope.equalsIgnoreCase("application")) {
return PageContext.APPLICATION_SCOPE;
} else {
- return -1;
+ return PageContext.PAGE_SCOPE;
}
}
}
1.2 +28 -80 jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/ListTag.java
Index: ListTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/ListTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ListTag.java 12 Dec 2000 15:34:33 -0000 1.1
+++ ListTag.java 8 Apr 2002 14:39:44 -0000 1.2
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/ListTag.java,v 1.1 2000/12/12 15:34:33 shemnon Exp $
- * $Revision: 1.1 $
- * $Date: 2000/12/12 15:34:33 $
+ * $Header: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/ListTag.java,v 1.2 2002/04/08 14:39:44 glenn Exp $
+ * $Revision: 1.2 $
+ * $Date: 2002/04/08 14:39:44 $
*
* ====================================================================
*
@@ -70,41 +70,30 @@
/**
*
* @author Danno Ferrin <sh...@earthlink.net>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class ListTag extends BodyTagSupport {
- Context context;
-
- String nameId, classId, objId;
- int nameScope, classScope, objScope;
-
- String name;
- Name nameObject;
- boolean bindings;
+ private Context context;
+ private String contextRef;
+ private String nameId;
+ private String classId;
+ private String objId;
+ private int nameScope = PageContext.PAGE_SCOPE;
+ private int classScope = PageContext.PAGE_SCOPE;
+ private int objScope = PageContext.PAGE_SCOPE;
+
+ private String name;
+ private Name nameObject;
+ private boolean bindings;
- NamingEnumeration nameEnum;
- NameClassPair currentListing;
+ private NamingEnumeration nameEnum;
+ private NameClassPair currentListing;
/** Creates new ListTag */
public ListTag() {
}
- public void setPageContext(PageContext pc) {
- context = null;
- nameId = null;
- nameScope = PageContext.PAGE_SCOPE;
- classId = null;
- classScope = PageContext.PAGE_SCOPE;
- objId = null;
- objScope = PageContext.PAGE_SCOPE;
- name = null;
- nameObject = null;
- bindings = false;
- nameEnum = null;
- super.setPageContext(pc);
- }
-
/** Getter for property context.
* @return Value of property context.
*/
@@ -125,10 +114,7 @@
* @param contextRef New value of property contextRef.
*/
public void setContextRef(String contextRef) {
- Object o = pageContext.findAttribute(contextRef);
- if (o instanceof Context) {
- setContext((Context)o);
- }
+ this.contextRef = contextRef;
}
/**
@@ -148,14 +134,6 @@
}
/**
- * Getter for property nameScope.
- * @return Value of property nameScope.
- */
- public String getNameScope() {
- return decodeScope(nameScope);
- }
-
- /**
* Setter for property nameScope.
* @param nameScope New value of property nameScope.
*/
@@ -180,14 +158,6 @@
}
/**
- * Getter for property classScope.
- * @return Value of property classScope.
- */
- public String getClassScope() {
- return decodeScope(classScope);
- }
-
- /**
* Setter for property classScope.
* @param classScope New value of property classScope.
*/
@@ -211,13 +181,6 @@
this.objId = objId;
}
- /** Getter for property objScope.
- * @return Value of property objScope.
- */
- public String getObjScope() {
- return decodeScope(objScope);
- }
-
/** Setter for property objScope.
* @param objScope New value of property objScope.
*/
@@ -274,6 +237,13 @@
}
public int doStartTag() throws JspException {
+ if( contextRef != null ) {
+ context = null;
+ Object o = pageContext.findAttribute(contextRef);
+ if (o instanceof Context) {
+ context = (Context)o;
+ }
+ }
if (context == null) {
throw new JspException("Context is not set for list itteration");
}
@@ -285,9 +255,6 @@
nameEnum = context.list(nameObject);
}
} else {
- //if (name == null) {
- // name = "";
- //}
if (bindings) {
nameEnum = context.listBindings(name);
} else {
@@ -301,11 +268,7 @@
return SKIP_BODY;
}
} catch (NamingException ne) {
- //XXX some sort of logging here?
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- PrintStream ps = new PrintStream(baos);
- ne.printStackTrace(ps);
- throw new JspException(baos.toString());
+ throw new JspTagException("JNDI list tag could not list bindings: "+ne.getMessage());
}
}
@@ -379,21 +342,6 @@
return EVAL_PAGE;
}
- static String decodeScope(int scope) {
- switch (scope) {
- case PageContext.PAGE_SCOPE:
- return "page";
- case PageContext.REQUEST_SCOPE:
- return "request";
- case PageContext.SESSION_SCOPE:
- return "session";
- case PageContext.APPLICATION_SCOPE:
- return "application";
- default:
- return null;
- }
- }
-
static int decodeScope(String scope) {
if (scope.equalsIgnoreCase("page")) {
return PageContext.PAGE_SCOPE;
@@ -401,7 +349,7 @@
return PageContext.REQUEST_SCOPE;
} else if (scope.equalsIgnoreCase("session")) {
return PageContext.SESSION_SCOPE;
- } else if (scope.equalsIgnoreCase("applicaiton")) {
+ } else if (scope.equalsIgnoreCase("application")) {
return PageContext.APPLICATION_SCOPE;
} else {
return -1;
1.2 +21 -54 jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/LookupTag.java
Index: LookupTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/LookupTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LookupTag.java 12 Dec 2000 15:34:33 -0000 1.1
+++ LookupTag.java 8 Apr 2002 14:39:44 -0000 1.2
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/LookupTag.java,v 1.1 2000/12/12 15:34:33 shemnon Exp $
- * $Revision: 1.1 $
- * $Date: 2000/12/12 15:34:33 $
+ * $Header: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/LookupTag.java,v 1.2 2002/04/08 14:39:44 glenn Exp $
+ * $Revision: 1.2 $
+ * $Date: 2002/04/08 14:39:44 $
*
* ====================================================================
*
@@ -70,31 +70,22 @@
/**
*
* @author Danno Ferrin <sh...@earthlink.net>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class LookupTag extends TagSupport {
- Context context;
-
- String name;
- int scope;
- String type;
- Name nameObject;
+ private Context context;
+ private String contextRef;
+ private String name = "";
+ private int scope = PageContext.PAGE_SCOPE;
+ private String type = "java.lang.Object";
+ private Name nameObject;
/** Creates new LookupTag */
public LookupTag() {
}
- public void setPageContext(PageContext pc) {
- context = null;
- name = null;
- nameObject = null;
- scope = PageContext.PAGE_SCOPE;
- type = "java.lang.Object";
- super.setPageContext(pc);
- }
-
/** Getter for property context.
* @return Value of property context.
*/
@@ -115,18 +106,7 @@
* @param contextRef New value of property contextRef.
*/
public void setContextRef(String contextRef) {
- Object o = pageContext.findAttribute(contextRef);
- if (o instanceof Context) {
- setContext((Context)o);
- }
- }
-
- /**
- * Getter for property scope.
- * @return Value of property scope.
- */
- public String getScope() {
- return decodeScope(scope);
+ this.contextRef = contextRef;
}
/**
@@ -190,6 +170,13 @@
}
public int doEndTag() throws JspException {
+ if( contextRef != null ) {
+ context = null;
+ Object o = pageContext.findAttribute(contextRef);
+ if (o instanceof Context) {
+ context = (Context)o;
+ }
+ }
if (context == null) {
throw new JspException("context not set in a lookup invocation");
}
@@ -198,9 +185,6 @@
if (nameObject != null) {
o = context.lookup(nameObject);
} else {
- if (name == null) {
- name = "";
- }
o = context.lookup(name);
}
if (Class.forName(type).isInstance(o)) {
@@ -217,32 +201,15 @@
return EVAL_PAGE;
}
- static String decodeScope(int scope) {
- switch (scope) {
- case PageContext.PAGE_SCOPE:
- return "page";
- case PageContext.REQUEST_SCOPE:
- return "request";
- case PageContext.SESSION_SCOPE:
- return "session";
- case PageContext.APPLICATION_SCOPE:
- return "application";
- default:
- return null;
- }
- }
-
static int decodeScope(String scope) {
- if (scope.equalsIgnoreCase("page")) {
- return PageContext.PAGE_SCOPE;
- } else if (scope.equalsIgnoreCase("request")) {
+ if (scope.equalsIgnoreCase("request")) {
return PageContext.REQUEST_SCOPE;
} else if (scope.equalsIgnoreCase("session")) {
return PageContext.SESSION_SCOPE;
- } else if (scope.equalsIgnoreCase("applicaiton")) {
+ } else if (scope.equalsIgnoreCase("application")) {
return PageContext.APPLICATION_SCOPE;
} else {
- return -1;
+ return PageContext.PAGE_SCOPE;
}
}
}
1.3 +48 -78 jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/SearchTag.java
Index: SearchTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/SearchTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SearchTag.java 6 Apr 2002 21:38:10 -0000 1.2
+++ SearchTag.java 8 Apr 2002 14:39:44 -0000 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/SearchTag.java,v 1.2 2002/04/06 21:38:10 glenn Exp $
- * $Revision: 1.2 $
- * $Date: 2002/04/06 21:38:10 $
+ * $Header: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/SearchTag.java,v 1.3 2002/04/08 14:39:44 glenn Exp $
+ * $Revision: 1.3 $
+ * $Date: 2002/04/08 14:39:44 $
*
* ====================================================================
*
@@ -71,31 +71,29 @@
/**
*
* @author Danno Ferrin <sh...@earthlink.net>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class SearchTag extends BodyTagSupport {
- protected int scope;
- protected String attributes;
- protected String attributeSeparator;
- protected SearchControls controls;
- protected DirContext context;
- protected String filter;
- protected NamingEnumeration nameEnum;
- protected SearchResult currentResult;
- protected String name;
- protected Name nameObject;
+ private int scope = PageContext.PAGE_SCOPE;
+ private String attributes;
+ private String attributeSeparator = ",";
+ private SearchControls controls;
+ private DirContext context;
+ private String contextRef;
+ private String filter;
+ private NamingEnumeration nameEnum;
+ private SearchResult currentResult;
+ private String name = "";
+ private Name nameObject;
/** Creates new SearchTag */
public SearchTag() {
}
- /**
- * Getter for property scope
- * @return Value of property scope.
- */
- public String getScope() {
- return decodeScope(scope);
+ public void setPageContext(PageContext pc) {
+ controls = new SearchControls();
+ super.setPageContext(pc);
}
/**
@@ -127,20 +125,7 @@
* @param contextRef New value of property contextRef.
*/
public void setContextRef(String contextRef) {
- Object o = pageContext.findAttribute(contextRef);
- if (o instanceof DirContext) {
- context = (DirContext) o;
- } else if (o instanceof Context) {
- try {
- // attempt a blank lookup
- o = ((Context)o).lookup("");
- if (o instanceof DirContext) {
- context = (DirContext) o;
- }
- } catch (NamingException ne) {
- // oh well, it failed, toss it out
- }
- }
+ this.contextRef = contextRef;
}
/**
@@ -240,7 +225,7 @@
}
/**
- * Getter for property attrbuteSeparator.
+ * Getter for property attributeSeparator.
* @return Value of property attrbuteSeparator.
*/
public String getAttributeSeparator() {
@@ -248,7 +233,7 @@
}
/**
- * Setter for property attrbuteSeparator.
+ * Setter for property attributeSeparator.
* @param attrbuteSeparator New value of property attrbuteSeparator.
*/
public void setAttributeSeparator(String attributeSeparator) {
@@ -303,22 +288,30 @@
controls.setTimeLimit(timeLimit);
}
- public void setPageContext(PageContext pc) {
- scope = PageContext.PAGE_SCOPE;
- attributes = null;
- attributeSeparator = ",";
- controls = new SearchControls();
- context = null;
- filter = null;
- nameEnum = null;
- currentResult = null;
- name = null;
- nameObject = null;
-
- super.setPageContext(pc);
- }
-
public int doStartTag() throws JspException {
+ // Initialize invocation variables
+ nameEnum = null;
+
+ if( contextRef != null ) {
+ context = null;
+ Object o = pageContext.findAttribute(contextRef);
+ if (o instanceof DirContext) {
+ context = (DirContext) o;
+ } else if (o instanceof Context) {
+ try {
+ // attempt a blank lookup
+ o = ((Context)o).lookup("");
+ if (o instanceof DirContext) {
+ context = (DirContext) o;
+ }
+ } catch (NamingException ne) {
+ // oh well, it failed, toss it out
+ }
+ }
+ }
+ if( context == null ) {
+ throw new JspException("JNDI search tag could not find a context");
+ }
String[] attrs = null;
if (attributes != null) {
if (attributes.length() == 0) {
@@ -348,16 +341,10 @@
if (nameObject != null) {
nameEnum = context.search(nameObject, filter, controls);
} else {
- if (name == null) {
- name = "";
- }
nameEnum = context.search(name, filter, controls);
}
} catch (NamingException ne) {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- PrintStream ps = new PrintStream(baos);
- ne.printStackTrace(ps);
- throw new JspException(baos.toString());
+ throw new JspException("JNDI search tag failed: "+ne.getMessage());
}
if (nameEnum.hasMoreElements()) {
@@ -433,32 +420,15 @@
}
}
- public static String decodeScope(int scope) {
- switch (scope) {
- case PageContext.PAGE_SCOPE:
- return "page";
- case PageContext.REQUEST_SCOPE:
- return "request";
- case PageContext.SESSION_SCOPE:
- return "session";
- case PageContext.APPLICATION_SCOPE:
- return "application";
- default:
- return null;
- }
- }
-
public static int decodeScope(String scope) {
- if (scope.equalsIgnoreCase("page")) {
- return PageContext.PAGE_SCOPE;
- } else if (scope.equalsIgnoreCase("request")) {
+ if (scope.equalsIgnoreCase("request")) {
return PageContext.REQUEST_SCOPE;
} else if (scope.equalsIgnoreCase("session")) {
return PageContext.SESSION_SCOPE;
- } else if (scope.equalsIgnoreCase("applicaiton")) {
+ } else if (scope.equalsIgnoreCase("application")) {
return PageContext.APPLICATION_SCOPE;
} else {
- return -1;
+ return PageContext.PAGE_SCOPE;
}
}
}
1.3 +13 -51 jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/UseContextTag.java
Index: UseContextTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/UseContextTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- UseContextTag.java 5 Mar 2001 18:18:25 -0000 1.2
+++ UseContextTag.java 8 Apr 2002 14:39:44 -0000 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/UseContextTag.java,v 1.2 2001/03/05 18:18:25 pierred Exp $
- * $Revision: 1.2 $
- * $Date: 2001/03/05 18:18:25 $
+ * $Header: /home/cvs/jakarta-taglibs/jndi/src/org/apache/taglibs/jndi/UseContextTag.java,v 1.3 2002/04/08 14:39:44 glenn Exp $
+ * $Revision: 1.3 $
+ * $Date: 2002/04/08 14:39:44 $
*
* ====================================================================
*
@@ -72,13 +72,13 @@
/**
*
* @author Danno Ferrin <sh...@earthlink.net>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class UseContextTag extends BodyTagSupport {
- Hashtable env;
+ Hashtable env = new Hashtable();
//id handled by bodytagsupport
- int scope;
+ private int scope = PageContext.PAGE_SCOPE;
String url;
/**
@@ -88,12 +88,6 @@
}
- public void setPageContext(PageContext pc) {
- env = new Hashtable();
- scope = -1;
- super.setPageContext(pc);
- }
-
/**
* Setter for property envRef.
* <BR>Bad refs will be silently ignored.
@@ -301,8 +295,8 @@
}
/**
- * Setter for property urlPkgPrefixes.
- * @param urlPkgPrefixes New value of property urlPkgPrefixes.
+ * Setter for property dnsUrl
+ * @param dnsUrl New value of property dnsUrl
*/
public void setDnsUrl(String dnsUrl) {
env.put(Context.DNS_URL, dnsUrl);
@@ -318,39 +312,16 @@
}
/**
- * Getter for property scope.
- * @return Value of property scope.
- */
- public String getScope() {
- switch (scope) {
- case PageContext.PAGE_SCOPE:
- return "page";
- case PageContext.REQUEST_SCOPE:
- return "request";
- case PageContext.SESSION_SCOPE:
- return "session";
- case PageContext.APPLICATION_SCOPE:
- return "application";
- default:
- return null;
- }
- }
-
- /**
* Setter for property scope.
* @param scope New value of property scope.
*/
public void setScope(String scope) {
- if (scope.equalsIgnoreCase("page")) {
- this.scope = PageContext.PAGE_SCOPE;
- } else if (scope.equalsIgnoreCase("request")) {
+ if (scope.equalsIgnoreCase("request")) {
this.scope = PageContext.REQUEST_SCOPE;
} else if (scope.equalsIgnoreCase("session")) {
this.scope = PageContext.SESSION_SCOPE;
- } else if (scope.equalsIgnoreCase("applicaiton")) {
+ } else if (scope.equalsIgnoreCase("application")) {
this.scope = PageContext.APPLICATION_SCOPE;
- } else {
- this.scope = -1;
}
}
@@ -372,19 +343,10 @@
if (o instanceof Context) {
ctx = (Context) o;
}
- } /*else {
- Object o = ctx.lookup("");
- if ((o instanceof Context) && (o != null)) {
- ctx = (Context) o;
- }
- }*/
+ }
return ctx;
} catch (NamingException ne) {
- //XXX add some sort of logging hook?
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- PrintStream ps = new PrintStream(baos);
- ne.printStackTrace(ps);
- throw new JspException(baos.toString());
+ throw new JspException("JNDI useContext tag could not find url: "+ne.getMessage());
}
}
@@ -402,8 +364,8 @@
if (o == null) {
pullInSupplimentalAttributes();
o = getObjectToExport();
+ pageContext.setAttribute(getId(), o, scope);
}
- pageContext.setAttribute(getId(), o, scope);
return EVAL_PAGE;
}
}
1.3 +1 -0 jakarta-taglibs/jndi/xml/intro.xml
Index: intro.xml
===================================================================
RCS file: /home/cvs/jakarta-taglibs/jndi/xml/intro.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- intro.xml 22 Jul 2001 15:32:13 -0000 1.2
+++ intro.xml 8 Apr 2002 14:39:44 -0000 1.3
@@ -54,6 +54,7 @@
<ul>
<li>Danno Ferrin</li>
+ <li>Glenn Nielsen</li>
</ul>
</section>
1.1 jakarta-taglibs/jndi/xml/jndi.xml
Index: jndi.xml
===================================================================
<?xml version="1.0" ?>
<!-- Change all instances of page with the jakarta-taglib
name for this tag library.
Change all instances of Page with the name to use
for things such as titles in the tag library documentation.
Change all instances of {your-name} with your name for
for things such as author name in the tag library documentation.
Change <prefix>foo</prefix> below to a short prefix for this
tag library.
-->
<document url="./page.xml">
<!-- More properties can be added. Good place to stick loose
data needed elsewhere. -->
<properties>
<!-- The title here overrides the title generated by the
stylesheet for the documentation HTML <title> tag
<title>Jakarta Project: JNDI JSP Tag Library</title>
-->
<!-- The name here is used in the HTML <meta name="author"...> tag -->
<author>Danno Ferrin</author>
</properties>
<!-- The following defines elements uses both to create the taglib
documentation and the tag library descriptor .tld file. The
elements used are those from the JSP 1.2 TLD DTD and special
elements used when creating the tagib documentation. Although
the JSP1.2 TLD DTD is used, this document can be used to
generate both a JSP 1.1 and a JSP 1.2 TLD.
-->
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.1</jsp-version>
<short-name>jndi</short-name>
<uri>http://jakarta.apache.org/taglibs/jndi</uri>
<display-name>JNDI Tag library (Beta 1)</display-name>
<description>
A tag library for using the Java Naming and Directory Interface (JNDI).
</description>
<!-- The taglib-location is used to fill in the web.xml configuration
information in the HTML doc. -->
<taglib-location>/WEB-INF/jndi.tld</taglib-location>
<!-- The prefix is used to fill in the taglib directive
configuration information in the HTML doc. -->
<prefix>jndi</prefix>
<!-- This element must be straight text and is copied right into
the "Requirements" section of the HTML doc. -->
<requirements-info>
<P>This custom tag library requires a servlet container that supports
the JavaServer Pages Specification, version 1.1.
</P>
<p>
This custom tag library requires the JNDI API. This comes as part of
Java 1.3. If you are using a version of Java prior to Java 1.3 you
will need to download the <a href="http://java.sun.com/products/jndi/">
JNDI API</a> from Sun and install it in your $JAVA_HOME/jre/lib/ext directory.
</p>
</requirements-info>
<tagtoc name="JNDI Tags">
<tag>
<name>useContext</name>
<tag-class>org.apache.taglibs.jndi.UseContextTag</tag-class>
<tei-class>org.apache.taglibs.jndi.UseContextTEI</tei-class>
<body-content>JSP</body-content>
<display-name>useContext</display-name>
<description>
This tag creates an instance of a javax.naming.Context based on the values
of the attributes providing some of the standard values. In addition to the
System properties and the jndi.properties, some standard properties are
scanned in the pageContext attributes.
<ul>
<li>note: should this be extended to the servlet init params as well?</li>
<li>note: as of right now this does not look into the id and scope to see if the
context already exists, so it does not behave entirely like useBean</li>
</ul>
</description>
<summary>Create a javax.naming.Context object for use after tag close.</summary>
<availability>1.0</availability>
<restrictions>
One of the following three attributes must be specified:
<ul>
<li>env</li>
<li>envRef</li>
<li>url</li>
</ul>
And one of the following three attributes must be specified:
One of the following three attributes must be specified:
<ul>
<li>initialFactory</li>
<li>providerUrl</li>
<li>url</li>
</ul>
</restrictions>
<attribute>
<name>envRef</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>
This is the name of an attribute that will be searched for that provides
additional environment information. This info is subordinate to the info
provided by the attributes to this tag.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>env</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Same as envRef, except that the value is of type java.util.Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>url</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
If provided, the context created by the other attributes is used to
create a context in which the parameter of this attribute is used to
preform a lookup(String) operation. The context returned from the lookup
will be the context returned by the tag.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>providerUrl</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Provides the value of the Context.PROVIDER_URL attribute to the
InitialContext environment Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>initialFactory</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Provides the value of the Context.INITIAL_CONTEXT_FACTORY attribute to
the InitialContext environment Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>dnsUrl</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Provides the value of the Context.DNS_URL attribute to the
InitialContext environment Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>authoritative</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Provides the value of the Context.AUTHORITATIVE attribute to the
InitialContext environment Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>batchsize</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Provides the value of the Context.BATCHSIZE attribute to the
InitialContext environment Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>objectFactories</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Provides the value of the Context.OBJECT_FACTORIES attribute to
the InitialContext environment Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>stateFactories</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Provides the value of the Context.STATE_FACTORIES attribute to
the InitialContext environment Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>urlPkgPrefixes</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Provides the value of the Context.URL_PKG_PREFIXES attribute to
the InitialContext environment Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>id</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
<description>
The name that the context is to be exported as.
(A potential future relaxation may make this optional, but it will only
be available to body content enclosed that asks for an implicit context)
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>scope</name>
<required>false</required> <!-- page presumed if absent -->
<rtexprvalue>false</rtexprvalue>
<description>
The scope the object is to be exported as. Default is 'page'.
Follows the JSP spec conventions.
</description>
<availability>1.0</availability>
</attribute>
</tag>
<tag>
<name>list</name>
<tag-class>org.apache.taglibs.jndi.ListTag</tag-class>
<tei-class>org.apache.taglibs.jndi.ListTEI</tei-class>
<body-content>JSP</body-content>
<display-name>list</display-name>
<description>
This tag iterates through the list returned by Context.list() and
the body content is evaluated for each iteration.
</description>
<summary>Lists the elements in a particular javax.naming.Context</summary>
<availability>1.0</availability>
<restrictions>
One of the following two attributes must be specified:
<ul>
<li>context</li>
<li>contextRef</li>
</ul>
</restrictions>
<attribute>
<name>contextRef</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Attribute name that will be searched for to provide the context.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>context</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
A literal instance of type javax.naming.Context to be used.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>nameId</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
The attribute name of the name listing to be exported
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>nameScope</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
The scope that the name object will be exported to (page is the default).
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>classId</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
The attribute name of the class name to be exported.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>classScope</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
The scope that the class name will be exported to (page is the default).
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>objId</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
The attribute name of the bound object listing to be exported.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>objScope</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
The scope that the bound object will be exported to (page is the default).
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>name</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
The name to preform the list against.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>nameObject</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Like name, a literal javax.naming.Name object to use to list against. If both this
and name are specified and the value is not null, this attribute is
the one used.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>bindings</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Whether or not bound objects are returned, <b>true</b> or <b>false</b>.
</description>
<availability>1.0</availability>
</attribute>
</tag>
<tag>
<name>lookup</name>
<tag-class>org.apache.taglibs.jndi.LookupTag</tag-class>
<tei-class>org.apache.taglibs.jndi.LookupTEI</tei-class>
<body-content>JSP</body-content>
<display-name>lookup</display-name>
<description>
Lookups and exports a particular entry in a javax.naming.Context.
</description>
<summary>This looks up a particular object and exports it.</summary>
<availability>1.0</availability>
<restrictions>
One of the following two attributes must be specified:
<ul>
<li>context</li>
<li>contextRef</li>
</ul>
</restrictions>
<attribute>
<name>contextRef</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Attribute name that will be searched for to provide the context.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>context</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
A literal instance of type javax.naming.Context to be used.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>id</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
<description>
Attribute name of the object to be exported.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>scope</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>
The scope the object is to be exported as. Default is 'page'.
Follows the JSP spec conventions.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>name</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
The name to preform the lookup against.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>nameObject</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Like name, a literal javax.naming.Name object to use to lookup. If both this
and name are specified and the value is not null, this attribute is
the one used.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>type</name>
<!-- the class to cast the looked up object to. Right now failure to
cast results in a null return. Adding an attribute failure with
string values null, exception, or classcast to return null, throw a
JSPExceptionm or to re-throw the class-cast is a thought. -->
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>
The class to cast the looked up object to. Right now failure to
cast results in a null return. The default is java.lang.Object.
This also determines the type of the exposed scripting variable.
[Adding an attribute failure with string values null, exception, or
classcast to return null, throw a JSPExceptionm or to re-throw the
class-cast is a thought.]
</description>
<availability>1.0</availability>
</attribute>
</tag>
<tag>
<name>useDirContext</name>
<tag-class>org.apache.taglibs.jndi.UseDirContextTag</tag-class>
<tei-class>org.apache.taglibs.jndi.UseDirContextTEI</tei-class>
<body-content>JSP</body-content>
<display-name>useDirContext</display-name>
<description>
This behaves exactly like useContext except that the object exported
will be of type javax.naming.directory.DirContext and the
InitialDirContext will be used to generate the contexts.
</description>
<summary>
Create a javax.naming.directory.DirContext object for use
after tag close.
</summary>
<availability>1.0</availability>
<restrictions>
One of the following three attributes must be specified:
<ul>
<li>env</li>
<li>envRef</li>
<li>url</li>
</ul>
And one of the following three attributes must be specified:
One of the following three attributes must be specified:
<ul>
<li>initialFactory</li>
<li>providerUrl</li>
<li>url</li>
</ul>
</restrictions>
<attribute>
<name>envRef</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>
This is the name of an attribute that will be searched for that provides
additional environment information. This info is subordinate to the info
provided by the attributes to this tag.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>env</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Same as envRef, except that the value is of type java.util.Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>url</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
If provided, the context created by the other attributes is used to
create a context in which the parameter of this attribute is used to
preform a lookup(String) operation. The context returned from the lookup
will be the context returned by the tag.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>providerUrl</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Provides the value of the Context.PROVIDER_URL attribute to the
InitialContext environment Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>initialFactory</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Provides the value of the Context.INITIAL_CONTEXT_FACTORY attribute to
the InitialContext environment Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>dnsUrl</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Provides the value of the Context.DNS_URL attribute to the
InitialContext environment Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>authoritative</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Provides the value of the Context.AUTHORITATIVE attribute to the
InitialContext environment Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>batchsize</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Provides the value of the Context.BATCHSIZE attribute to the
InitialContext environment Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>objectFactories</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Provides the value of the Context.OBJECT_FACTORIES attribute to
the InitialContext environment Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>stateFactories</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Provides the value of the Context.STATE_FACTORIES attribute to
the InitialContext environment Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>urlPkgPrefixes</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Provides the value of the Context.URL_PKG_PREFIXES attribute to
the InitialContext environment Hashtable.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>id</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
<description>
The name that the context is to be exported as.
(A potential future relaxation may make this optional, but it will only
be available to body content enclosed that asks for an implicit context)
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>scope</name>
<required>false</required> <!-- page presumed if absent -->
<rtexprvalue>false</rtexprvalue>
<description>
The scope the object is to be exported as. Default is 'page'.
Follows the JSP spec conventions.
</description>
<availability>1.0</availability>
</attribute>
</tag>
<tag>
<name>search</name>
<tag-class>org.apache.taglibs.jndi.SearchTag</tag-class>
<tei-class>org.apache.taglibs.jndi.SearchTEI</tei-class>
<body-content>JSP</body-content>
<display-name>search</display-name>
<description>
Performs a search against a DirContext according to the semantics
of the search(Name name, String filter, SearchControls cons) in
javax.naming.directory.DirContext.
</description>
<summary>Searches a DirContext.</summary>
<availability>1.0</availability>
<restrictions>
One of the following two attributes must be specified:
<ul>
<li>context</li>
<li>contextRef</li>
</ul>
</restrictions>
<attribute>
<name>id</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
<description>
Attribute name of the SearchResult to be exported.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>scope</name>
<required>false</required> <!-- page presumed if absent -->
<rtexprvalue>false</rtexprvalue>
<description>
The scope the object is to be exported as. Default is 'page'.
Follows the JSP spec conventions.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>contextRef</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Attribute name that will be searched for to provide the context.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>context</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
A literal instance of type javax.naming.Context to be used.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>name</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
The name to preform the lookup against.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>nameObject</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Like name, a literal javax.naming.Name object to use to lookup. If both this
and name are specified and the value is not null, this attribute is
the one used.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>filter</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<description>
The LDAP-style search filter to use.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>countLimit</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
The maximum number of entries to return. Default is 0 which _should_
mean return all entries found (but behavior has been observerved in some
provider/server combinations to mean none).
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>derefLink</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Determines whether links will be dereferenced during the search.
Set to <b>true</b> or <b>false</b>, default is <b>false</b>.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>attributes</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
A (generally) comma seperated list of attributes to return in the
search results. Default is null which means return all.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>attributeSeparator</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
If comma seperated attributes won't do, provides an alternate
delimiter string for the attributes attribute. Default is ",".
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>bindings</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
Whether or not to return bound objects.
Set to <b>true</b> or <b>false</b>, default is <b>false</b>.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>searchScope</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
What scope the search is to be preformed against. One of subtree,
subtree_scope, onelevel, onelevel_scope, object, object_scope. (The
variants are treated as the the _scope variants).
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>timeLimit</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
The time limit in ms to wait. 0 means wait indefinatly.
</description>
<availability>1.0</availability>
</attribute>
</tag>
<tag>
<name>getAttribute</name>
<tag-class>org.apache.taglibs.jndi.GetAttributeTag</tag-class>
<tei-class>org.apache.taglibs.jndi.GetAttributeTEI</tei-class>
<body-content>JSP</body-content> <!-- and will be the seperator for multi-value resposnes -->
<display-name>getAttribute</display-name>
<description>
This is a flexible tag to get an attribute. The specified object can be
a DirContext, SearchResult, Attributes, or an Attribute. If the object is
a DirContext an Attributes object is retrieved with just the requested
attribute, and then further processed. If it is a SearchResult then the
return of getAttributes is processed further. For any Attributes object
passed in explicitly or derived the get(attribute) method is executed and
stored as the attribute.
The contents of the attribute are processed in one of three ways depending
on the value of the multivalue tag attribute. If the value is 'one' then
the value returned by Attribute.get() is written to the output stream and
the body is skipped. For 'separator' then the body of the tag servers as a
separator for the attribute values in the event of multivalue attributes,
but it is skipped in the event of a singly valued or non-existant
attribute, and the value of the attribute is explicitly written to the
appropriate output stream. And for the case of 'iterate' the the
contents of the body are iterated over for each value of the attribute,
whether singly valued or multi-valued (and skipped for a non-existant
attribute). In all cases the attribute is exported to the id and scope
if provided at the beginning of the tag, so it is available both within the
tag and after it's execution.
</description>
<summary>Extracts an attribute from a DirContext, a SearchResult, or an Attributes.</summary>
<availability>1.0</availability>
<restrictions>NONE</restrictions>
<attribute>
<name>id</name>
<required>flase</required>
<rtexprvalue>false</rtexprvalue>
<description>
Page Context attribute name of the actual Attribute value to be exported.
For multivalued attributes where the multivalue mode is 'separator' no
attribute is exported, while for the value of 'iterator' it is the current
value inside the body content or the final value outside the tag. For
'one' it is the only value of the attribute.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>scope</name>
<required>false</required> <!-- page presumed if absent -->
<rtexprvalue>false</rtexprvalue>
<description>
The scope the object is to be exported as. Default is 'page'.
Follows the JSP spec conventions.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>ref</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
A refrence to a PageContext attribute to be searched for to use as the
object to preform attribute operations against.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>object</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
A literal instance of an object to have the attribute operations
applied against. An invalid object type will result in the body content
being skipped an no output being written to the output stream.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>attribute</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>
The name of the attribute to use for objects of type DirContext,
SearchResult and Attributes. Ignored for object of type Attribute.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>multivalue</name> <!-- either one, separator, or iterate -->
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
One of 'one', 'separator', or 'iterate'. Se tag description for details.
</description>
<availability>1.0</availability>
</attribute>
</tag>
<tag>
<name>forEachAttribute</name>
<tag-class>org.apache.taglibs.jndi.ForEachAttributeTag</tag-class>
<tei-class>org.apache.taglibs.jndi.ForEachAttributeTEI</tei-class>
<body-content>JSP</body-content>
<display-name>forEachAttribute</display-name>
<description>
This tag allows you to iterate through all of the attribute names returned
for a DirContext, SearchResult, or an Attributes object.
</description>
<summary>Iterates attributes form a DirContext, Attributes, or SearchResult.</summary>
<availability>1.0</availability>
<restrictions>NONE</restrictions>
<attribute>
<name>id</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
<description>
Page Context attribute name of the actual Attribute to be exported.
This is the name exposed within the tag Body and after. It is the
Attribute object and not the value of the attribute.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>scope</name>
<required>false</required> <!-- page presumed if absent -->
<rtexprvalue>false</rtexprvalue>
<description>
The scope the object is to be exported as. Default is 'page'.
Follows the JSP spec conventions.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>ref</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
A refrence to a PageContext attribute to be searched for to use as the
object to preform attribute operations against. Valid types are
DirContext, SearchResults, and Attributes.
</description>
<availability>1.0</availability>
</attribute>
<attribute>
<name>object</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
A literal instance of an object to have the attribute operations
applied against. An invalid object type will result in the body content
being skipped an no output being written to the output stream. Valid
types are DirContext, SearchResults, and Attributes.
</description>
<availability>1.0</availability>
</attribute>
</tag>
</tagtoc>
</taglib>
<revision release="Development" date="04/06/2002">
<description>
Update to new build, fancy docs, and a few bug fixes.
</description>
<section name="Tag Changes">
<item>
Changed the name of the <b>itterate</b> arg to
the <b>getAttribute</b> tag <b>multivalue</b> attribute
to <b>iterate</b>.
</item>
</section>
</revision>
<revision release="Development" date="12/12/2000">
<description>
Initial version of tag library before Jakarta-Taglibs
had an official release policy for tag libraries.
</description>
</revision>
</document>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>