remm 01/09/24 01:15:35
Modified: src/taglib/common/org/apache/slide/taglib/tag
DomainTagSupport.java NamespaceTagSupport.java
src/taglib/struts/org/apache/slide/taglib/tag/struts
StrutsTagUtils.java
Log:
- Also lookup the namespace name in the servlet context.
- Expose the enumerateNames property in the domain tag.
Revision Changes Path
1.3 +21 -4
jakarta-slide/src/taglib/common/org/apache/slide/taglib/tag/DomainTagSupport.java
Index: DomainTagSupport.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/taglib/common/org/apache/slide/taglib/tag/DomainTagSupport.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DomainTagSupport.java 2001/09/20 13:31:22 1.2
+++ DomainTagSupport.java 2001/09/24 08:15:35 1.3
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/taglib/common/org/apache/slide/taglib/tag/DomainTagSupport.java,v
1.2 2001/09/20 13:31:22 dirkv Exp $
- * $Revision: 1.2 $
- * $Date: 2001/09/20 13:31:22 $
+ * $Header:
/home/cvs/jakarta-slide/src/taglib/common/org/apache/slide/taglib/tag/DomainTagSupport.java,v
1.3 2001/09/24 08:15:35 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2001/09/24 08:15:35 $
*
* ====================================================================
*
@@ -75,7 +75,7 @@
* variable.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Christopher Lenz</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public abstract class DomainTagSupport
extends TagSupport {
@@ -157,6 +157,23 @@
super.release();
init();
+ }
+
+
+ // ------------------------------------------------------------- Properties
+
+
+ /**
+ * Returns the names of all namespaces defined in the Slide domain.
+ *
+ * @return a Vector of String objects in no particular order, each
+ * containing the name of a namespace
+ *
+ * @see #getNamespaces
+ */
+ public java.util.Vector getNamespaceNames() {
+
+ return domain.getNamespaceNames();
}
1.3 +12 -5
jakarta-slide/src/taglib/common/org/apache/slide/taglib/tag/NamespaceTagSupport.java
Index: NamespaceTagSupport.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/taglib/common/org/apache/slide/taglib/tag/NamespaceTagSupport.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NamespaceTagSupport.java 2001/09/20 13:31:22 1.2
+++ NamespaceTagSupport.java 2001/09/24 08:15:35 1.3
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/taglib/common/org/apache/slide/taglib/tag/NamespaceTagSupport.java,v
1.2 2001/09/20 13:31:22 dirkv Exp $
- * $Revision: 1.2 $
- * $Date: 2001/09/20 13:31:22 $
+ * $Header:
/home/cvs/jakarta-slide/src/taglib/common/org/apache/slide/taglib/tag/NamespaceTagSupport.java,v
1.3 2001/09/24 08:15:35 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2001/09/24 08:15:35 $
*
* ====================================================================
*
@@ -78,7 +78,7 @@
* scripting variable.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Christopher Lenz</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public abstract class NamespaceTagSupport
extends TagSupport {
@@ -180,7 +180,6 @@
* @return the value of the 'name' attribute
*/
public String getName() {
-
return name;
}
@@ -229,6 +228,13 @@
// look for a 'namespace' context parameter, and use its value
// as namespace name if present
ServletContext context = pageContext.getServletContext();
+ name = (String) context.getAttribute
+ ("org.apache.slide.NamespaceName");
+ }
+ if (name == null) {
+ // look for a 'namespace' context parameter, and use its value
+ // as namespace name if present
+ ServletContext context = pageContext.getServletContext();
name = context.getInitParameter("namespace");
}
if (name == null) {
@@ -238,6 +244,7 @@
if (name != null) {
bean = domain.getNamespace(name);
+ setName(name);
}
return bean;
1.5 +10 -5
jakarta-slide/src/taglib/struts/org/apache/slide/taglib/tag/struts/StrutsTagUtils.java
Index: StrutsTagUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/taglib/struts/org/apache/slide/taglib/tag/struts/StrutsTagUtils.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- StrutsTagUtils.java 2001/09/23 13:21:03 1.4
+++ StrutsTagUtils.java 2001/09/24 08:15:35 1.5
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/taglib/struts/org/apache/slide/taglib/tag/struts/StrutsTagUtils.java,v
1.4 2001/09/23 13:21:03 cmlenz Exp $
- * $Revision: 1.4 $
- * $Date: 2001/09/23 13:21:03 $
+ * $Header:
/home/cvs/jakarta-slide/src/taglib/struts/org/apache/slide/taglib/tag/struts/StrutsTagUtils.java,v
1.5 2001/09/24 08:15:35 remm Exp $
+ * $Revision: 1.5 $
+ * $Date: 2001/09/24 08:15:35 $
*
* ====================================================================
*
@@ -86,7 +86,7 @@
* Struts tag library, especially the <code><logic:iterate></code> tag.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Christopher Lenz</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class StrutsTagUtils {
@@ -166,7 +166,12 @@
DomainBean domain = findDomain(from, context);
if (domain != null) {
String namespaceName =
- context.getServletContext().getInitParameter("namespace");
+ (String) context.getServletContext().getAttribute
+ ("org.apache.slide.NamespaceName");
+ if (namespaceName == null) {
+ namespaceName =
+ context.getServletContext().getInitParameter("namespace");
+ }
if (namespaceName != null) {
bean = domain.getNamespace(namespaceName);
} else {