Author: dklco
Date: Mon May 20 17:25:00 2013
New Revision: 1484535

URL: http://svn.apache.org/r1484535
Log:
Cleaning up and organizing the TLD file and adding an  error handler to throw a 
descriptive error if a null resource resolver is passed into the EL functions

Modified:
    
sling/trunk/bundles/scripting/jsp-taglib/src/main/java/org/apache/sling/scripting/jsp/taglib/SlingFunctions.java
    
sling/trunk/bundles/scripting/jsp-taglib/src/main/resources/META-INF/taglib13.tld

Modified: 
sling/trunk/bundles/scripting/jsp-taglib/src/main/java/org/apache/sling/scripting/jsp/taglib/SlingFunctions.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/jsp-taglib/src/main/java/org/apache/sling/scripting/jsp/taglib/SlingFunctions.java?rev=1484535&r1=1484534&r2=1484535&view=diff
==============================================================================
--- 
sling/trunk/bundles/scripting/jsp-taglib/src/main/java/org/apache/sling/scripting/jsp/taglib/SlingFunctions.java
 (original)
+++ 
sling/trunk/bundles/scripting/jsp-taglib/src/main/java/org/apache/sling/scripting/jsp/taglib/SlingFunctions.java
 Mon May 20 17:25:00 2013
@@ -142,6 +142,9 @@ public class SlingFunctions {
                log.trace("getResource");
 
                log.debug("Getting resource at path {}", path);
+               if(resolver == null){
+                       throw new IllegalArgumentException("Null resource 
resolver");
+               }
                return resolver.getResource(path);
        }
 

Modified: 
sling/trunk/bundles/scripting/jsp-taglib/src/main/resources/META-INF/taglib13.tld
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/jsp-taglib/src/main/resources/META-INF/taglib13.tld?rev=1484535&r1=1484534&r2=1484535&view=diff
==============================================================================
--- 
sling/trunk/bundles/scripting/jsp-taglib/src/main/resources/META-INF/taglib13.tld
 (original)
+++ 
sling/trunk/bundles/scripting/jsp-taglib/src/main/resources/META-INF/taglib13.tld
 Mon May 20 17:25:00 2013
@@ -395,37 +395,8 @@
                                object.
                        </description>
                        <name>var</name>
-                       <required>false</required>
-                       <rtexprvalue>true</rtexprvalue>
-               </attribute>
-       </tag>
-
-       <tag>
-               <description>
-                       Lists the children of a Sling Resource.
-               </description>
-               <name>listChildren</name>
-               <tag-class>
-                       org.apache.sling.scripting.jsp.taglib.ListChildrenTag
-               </tag-class>
-               <body-content>empty</body-content>
-               <attribute>
-                       <description>
-                               The resource for which to retrieve the children.
-                       </description>
-                       <name>resource</name>
                        <required>true</required>
                        <rtexprvalue>true</rtexprvalue>
-                       <type>org.apache.sling.api.resource.Resource</type>
-               </attribute>
-               <attribute>
-                       <description>
-                               The name of the variable to which to save the 
child
-                               resources.
-                       </description>
-                       <name>var</name>
-                       <required>false</required>
-                       <rtexprvalue>true</rtexprvalue>
                </attribute>
        </tag>
 
@@ -460,49 +431,9 @@
                                The name of the variable to which to save the 
resources.
                        </description>
                        <name>var</name>
-                       <required>false</required>
-                       <rtexprvalue>true</rtexprvalue>
-               </attribute>
-       </tag>
-
-       <tag>
-               <description>
-                       Retrieves resources based on either an absolute path or 
a
-                       relative path and a
-                       base resource.
-               </description>
-               <name>getResource</name>
-               <tag-class>
-                       org.apache.sling.scripting.jsp.taglib.GetResourceTag
-               </tag-class>
-               <body-content>empty</body-content>
-               <attribute>
-                       <description>
-                               The base resource under which to retrieve the 
child
-                               resource, will only
-                               be considered if a relative path is specified.
-                       </description>
-                       <name>base</name>
-                       <required>false</required>
-                       <rtexprvalue>true</rtexprvalue>
-               </attribute>
-               <attribute>
-                       <description>
-                               The path of the resource to retrieve, if 
relative, the
-                               base resource must be specified.
-                       </description>
-                       <name>path</name>
                        <required>true</required>
                        <rtexprvalue>true</rtexprvalue>
                </attribute>
-               <attribute>
-                       <description>
-                               The name of the variable to which to save the 
resource.
-                       </description>
-                       <name>var</name>
-                       <required>false</required>
-                       <rtexprvalue>true</rtexprvalue>
-               </attribute>
        </tag>
 
        <tag>
@@ -557,5 +488,73 @@
                        <rtexprvalue>true</rtexprvalue>
                </attribute>
        </tag>
+
+    <tag>
+        <description>
+            Retrieves resources based on either an absolute path or a
+            relative path and a base resource.
+        </description>
+        <name>getResource</name>
+        <tag-class>
+            org.apache.sling.scripting.jsp.taglib.GetResourceTag
+        </tag-class>
+        <body-content>empty</body-content>
+        <attribute>
+            <description>
+                The base resource under which to retrieve the child
+                resource, will only
+                be considered if a relative path is specified.
+            </description>
+            <name>base</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <description>
+                The path of the resource to retrieve, if relative, the
+                base resource must be specified.
+            </description>
+            <name>path</name>
+            <required>true</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <description>
+                The name of the variable to which to save the resource.
+            </description>
+            <name>var</name>
+            <required>true</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+    </tag>
+    
+    <tag>
+        <description>
+            Lists the children of a Sling Resource.
+        </description>
+        <name>listChildren</name>
+        <tag-class>
+            org.apache.sling.scripting.jsp.taglib.ListChildrenTag
+        </tag-class>
+        <body-content>empty</body-content>
+        <attribute>
+            <description>
+                The resource for which to retrieve the children.
+            </description>
+            <name>resource</name>
+            <required>true</required>
+            <rtexprvalue>true</rtexprvalue>
+            <type>org.apache.sling.api.resource.Resource</type>
+        </attribute>
+        <attribute>
+            <description>
+                The name of the variable to which to save the child
+                resources.
+            </description>
+            <name>var</name>
+            <required>true</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+    </tag>
 </taglib>
 


Reply via email to