struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject svn commit: r124049 - /struts/sandbox/trunk/struts-shale/src/conf/taglib.tld /struts/sandbox/trunk/struts-shale/src/java/org/apache/shale/faces/ShaleViewHandler.java /struts/sandbox/trunk/struts-shale/src/java/org/apache/shale/util/Messages.java
Date Tue, 04 Jan 2005 01:02:07 GMT
Author: craigmcc
Date: Mon Jan  3 17:02:05 2005
New Revision: 124049

URL: http://svn.apache.org/viewcvs?view=rev&rev=124049
Log:
Miscellaneous fixes:

* ShaleViewHandler - correctly deal with a JSP page that has
  no corresponding ViewController defined as a manageed bean,
  instead of throwing NPE.

* Messages - return null if no entry found for a key, instead
  of throwing MissingResourceException.

* taglib.tld - correct element names for <rtexprvalue> elements.


Modified:
   struts/sandbox/trunk/struts-shale/src/conf/taglib.tld
   struts/sandbox/trunk/struts-shale/src/java/org/apache/shale/faces/ShaleViewHandler.java
   struts/sandbox/trunk/struts-shale/src/java/org/apache/shale/util/Messages.java

Modified: struts/sandbox/trunk/struts-shale/src/conf/taglib.tld
Url: http://svn.apache.org/viewcvs/struts/sandbox/trunk/struts-shale/src/conf/taglib.tld?view=diff&rev=124049&p1=struts/sandbox/trunk/struts-shale/src/conf/taglib.tld&r1=124048&p2=struts/sandbox/trunk/struts-shale/src/conf/taglib.tld&r2=124049
==============================================================================
--- struts/sandbox/trunk/struts-shale/src/conf/taglib.tld	(original)
+++ struts/sandbox/trunk/struts-shale/src/conf/taglib.tld	Mon Jan  3 17:02:05 2005
@@ -55,7 +55,7 @@
     <attribute>
       <name>binding</name>
       <required>false</required>
-      <exprvalue>false</exprvalue>
+      <rtexprvalue>false</rtexprvalue>
       <description>
         Value binding expression used to bind this component instance
         to a backing bean property.
@@ -65,7 +65,7 @@
     <attribute>
       <name>id</name>
       <required>false</required>
-      <exprvalue>false</exprvalue>
+      <rtexprvalue>false</rtexprvalue>
       <description>
         Component identifier of this component.  If specified, this identifier
         must be unique within the context of the closest parent UIComponent
@@ -76,7 +76,7 @@
     <attribute>
       <name>rendered</name>
       <required>false</required>
-      <exprvalue>false</exprvalue>
+      <rtexprvalue>false</rtexprvalue>
       <description>
         Flag indicating whether this component should be rendered.
         Default value is true.

Modified: struts/sandbox/trunk/struts-shale/src/java/org/apache/shale/faces/ShaleViewHandler.java
Url: http://svn.apache.org/viewcvs/struts/sandbox/trunk/struts-shale/src/java/org/apache/shale/faces/ShaleViewHandler.java?view=diff&rev=124049&p1=struts/sandbox/trunk/struts-shale/src/java/org/apache/shale/faces/ShaleViewHandler.java&r1=124048&p2=struts/sandbox/trunk/struts-shale/src/java/org/apache/shale/faces/ShaleViewHandler.java&r2=124049
==============================================================================
--- struts/sandbox/trunk/struts-shale/src/java/org/apache/shale/faces/ShaleViewHandler.java
(original)
+++ struts/sandbox/trunk/struts-shale/src/java/org/apache/shale/faces/ShaleViewHandler.java
Mon Jan  3 17:02:05 2005
@@ -221,14 +221,15 @@
             context.getApplication().createValueBinding("#{" + viewName + "}");
         ViewController vc = null;
         try {
-            vc = (ViewController) vb.getValue(context);
+            Object vcObject = vb.getValue(context);
+            if (vcObject == null) {
+                log.warn(messages.getMessage("view.noViewController",
+                                             new Object[] { viewId, viewName }));
+                return;
+            }
+            vc = (ViewController) vcObject;
         } catch (ClassCastException e) {
             log.warn(messages.getMessage("view.notViewController", 
-                                         new Object[] { viewId, viewName }));
-            return;
-        }
-        if (vc == null) {
-            log.warn(messages.getMessage("view.noViewController",
                                          new Object[] { viewId, viewName }));
             return;
         }

Modified: struts/sandbox/trunk/struts-shale/src/java/org/apache/shale/util/Messages.java
Url: http://svn.apache.org/viewcvs/struts/sandbox/trunk/struts-shale/src/java/org/apache/shale/util/Messages.java?view=diff&rev=124049&p1=struts/sandbox/trunk/struts-shale/src/java/org/apache/shale/util/Messages.java&r1=124048&p2=struts/sandbox/trunk/struts-shale/src/java/org/apache/shale/util/Messages.java&r2=124049
==============================================================================
--- struts/sandbox/trunk/struts-shale/src/java/org/apache/shale/util/Messages.java	(original)
+++ struts/sandbox/trunk/struts-shale/src/java/org/apache/shale/util/Messages.java	Mon Jan
 3 17:02:05 2005
@@ -20,6 +20,7 @@
 import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map;
+import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
 /**
@@ -139,7 +140,11 @@
     public String getMessage(String key, Locale locale) {
 
         ResourceBundle rb = getBundle(locale);
-        return rb.getString(key);
+        try {
+            return rb.getString(key);
+        } catch (MissingResourceException e) {
+            return null;
+        }
 
     }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message