You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by jh...@apache.org on 2005/06/15 20:46:04 UTC

svn commit: r190790 - in /struts/taglib/trunk/src/java/org/apache/struts/taglib/html: FormTag.java LocalStrings.properties

Author: jholmes
Date: Wed Jun 15 11:46:03 2005
New Revision: 190790

URL: http://svn.apache.org/viewcvs?rev=190790&view=rev
Log:
Update FormTag to provide better debug message in the scenario
where an action mapping is missing a form bean name.

Modified:
    struts/taglib/trunk/src/java/org/apache/struts/taglib/html/FormTag.java
    struts/taglib/trunk/src/java/org/apache/struts/taglib/html/LocalStrings.properties

Modified: struts/taglib/trunk/src/java/org/apache/struts/taglib/html/FormTag.java
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/html/FormTag.java?rev=190790&r1=190789&r2=190790&view=diff
==============================================================================
--- struts/taglib/trunk/src/java/org/apache/struts/taglib/html/FormTag.java (original)
+++ struts/taglib/trunk/src/java/org/apache/struts/taglib/html/FormTag.java Wed Jun 15 11:46:03 2005
@@ -758,8 +758,14 @@
         // Look up the form bean definition
         FormBeanConfig formBeanConfig = moduleConfig.findFormBeanConfig(mapping.getName());
         if (formBeanConfig == null) {
-            JspException e =
-                new JspException(messages.getMessage("formTag.formBean", mapping.getName(), action));
+        	JspException e = null;
+
+        	if (mapping.getName() == null) {
+        		e = new JspException(messages.getMessage("formTag.name", action));
+            } else {
+	            e = new JspException(messages.getMessage("formTag.formBean", mapping.getName(), action));
+	        }
+	        
             pageContext.setAttribute(Globals.EXCEPTION_KEY, e, PageContext.REQUEST_SCOPE);
             throw e;
         }

Modified: struts/taglib/trunk/src/java/org/apache/struts/taglib/html/LocalStrings.properties
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/html/LocalStrings.properties?rev=190790&r1=190789&r2=190790&view=diff
==============================================================================
--- struts/taglib/trunk/src/java/org/apache/struts/taglib/html/LocalStrings.properties (original)
+++ struts/taglib/trunk/src/java/org/apache/struts/taglib/html/LocalStrings.properties Wed Jun 15 11:46:03 2005
@@ -3,8 +3,9 @@
 enumerateTag.enumeration=Cannot create enumeration for {0}
 formTag.collections=Cannot find ActionMappings or ActionFormBeans collection
 formTag.create=Exception creating bean of class {0}: {1}
-formTag.formBean=Cannot retrieve definition for form bean {0} on action {1}
-formTag.mapping=Cannot retrieve mapping for action {0}
+formTag.formBean=Cannot retrieve definition for form bean: "{0}" on action: "{1}"
+formTag.mapping=Cannot retrieve mapping for action: "{0}"
+formTag.name=Form bean not specified on mapping for action: "{0}"
 formTag.nameType=Must specify type attribute if name is specified
 forwardTag.forward=Error forwarding to page {0}: {1}
 forwardTag.lookup=Cannot find global forward named {0}



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