Author: dolander
Date: Fri Mar 18 07:34:33 2005
New Revision: 158085

URL: http://svn.apache.org/viewcvs?view=rev&rev=158085
Log:
Jira 430 -- Prevent setting null as the map value in a parameter map.


Modified:
    
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ParameterMap.java
    
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties

Modified: 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ParameterMap.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ParameterMap.java?view=diff&r1=158084&r2=158085
==============================================================================
--- 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ParameterMap.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ParameterMap.java
 Fri Mar 18 07:34:33 2005
@@ -95,6 +95,10 @@
      */
     public void setMap(Map map) throws JspException
     {
+        if (map == null) {
+            String s = Bundle.getString("Tags_MapAttrValueRequired", new 
Object[]{"map"});
+            registerTagError(s, null);
+        }
         _map = map;
     }
 
@@ -104,6 +108,9 @@
      */
     public int doStartTag() throws JspException
     {
+        if (hasErrors())
+            return reportAndExit(SKIP_BODY);
+
         Tag parentTag = findAncestorWithClass(this, IUrlParams.class);
         if (parentTag != null) {
             // this map shouldn't be null because the attribute is required.

Modified: 
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties?view=diff&r1=158084&r2=158085
==============================================================================
--- 
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties
 (original)
+++ 
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties
 Fri Mar 18 07:34:33 2005
@@ -4,6 +4,7 @@
 Tags_WriteException=JspException writting to the response.
 Tags_NotURLRewriter={0} is not a URLRewriter.
 Tags_AttrValueRequired=Attribute ''{0}'' is required to have a value.  The 
value "" is illegal.  This is often cause by binding to an object with a null 
value.
+Tags_MapAttrValueRequired=Attribute ''{0}'' is required to have a Map value.  
The value null is illegal.  This is often cause by binding to an object with a 
null value.
 Tags_BadAction=Action ''{0}'' is not a valid action.
 Tags_NullBadAction=Action was resolved as "", this is probably the result of 
an expression bound to a null Object.
 Tags_NullAction=The expression {0} results in a null action.


Reply via email to