You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by cr...@apache.org on 2002/08/09 01:53:44 UTC
cvs commit: jakarta-struts/src/share/org/apache/struts/util LocalStrings.properties RequestUtils.java
craigmcc 2002/08/08 16:53:44
Modified: src/share/org/apache/struts/util LocalStrings.properties
RequestUtils.java
Log:
Improve the usefulness of at least one error message. If you call
RequestUtils.lookup(), or one of the Struts tags does this, having specified
a name but not a scope, and no bean of that name was found in any scope,
the former message said
Cannot find bean foo in scope null
It will now say
Cannot find bean foo in any scope
PR: Bugzilla #11437
Submitted by: Martin Krzysiak <cinekcvs at gmx.net>
Revision Changes Path
1.6 +1 -0 jakarta-struts/src/share/org/apache/struts/util/LocalStrings.properties
Index: LocalStrings.properties
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/util/LocalStrings.properties,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- LocalStrings.properties 20 Nov 2001 03:07:29 -0000 1.5
+++ LocalStrings.properties 8 Aug 2002 23:53:44 -0000 1.6
@@ -5,6 +5,7 @@
computeURL.specifier=You must specify exactly one of "forward", "href", or "page"
lookup.access=Invalid access looking up property {0} of bean {1}
lookup.bean=Cannot find bean {0} in scope {1}
+lookup.bean.any=Cannot find bean {0} in any scope
lookup.method=No getter method for property {0} of bean {1}
lookup.scope=Invalid bean scope {0}
lookup.target=Exception thrown by getter for property {0} of bean {1}
1.52 +12 -6 jakarta-struts/src/share/org/apache/struts/util/RequestUtils.java
Index: RequestUtils.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/util/RequestUtils.java,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- RequestUtils.java 27 Jul 2002 23:26:08 -0000 1.51
+++ RequestUtils.java 8 Aug 2002 23:53:44 -0000 1.52
@@ -709,8 +709,14 @@
// Look up the requested bean, and return if requested
Object bean = lookup(pageContext, name, scope);
if (bean == null) {
- JspException e = new JspException
- (messages.getMessage("lookup.bean", name, scope));
+ JspException e = null;
+ if (scope == null) {
+ e = new JspException
+ (messages.getMessage("lookup.bean.any", name));
+ } else {
+ e = new JspException
+ (messages.getMessage("lookup.bean", name, scope));
+ }
saveException(pageContext, e);
throw e;
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>