craigmcc 01/06/11 10:34:41
Modified: src/share/org/apache/struts/taglib/logic Tag:
STRUTS_1_0_BRANCH PresentTag.java
Log:
Update processing of the <logic:present> and <logic:notPresent> tags to
reflect the fact that the four-argument version of RequestUtils.lookup()
will now throw an exception if the bean named by the "name" parameter is
not found. It is my belief that all other tags that call this lookup()
method are correctly dealing with the exception.
PR: Bugzilla #2112
Submitted by: Johan Compagner <[EMAIL PROTECTED]>
Revision Changes Path
No revision
No revision
1.7.2.1 +11 -6
jakarta-struts/src/share/org/apache/struts/taglib/logic/PresentTag.java
Index: PresentTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/logic/PresentTag.java,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -r1.7 -r1.7.2.1
--- PresentTag.java 2001/02/12 21:49:58 1.7
+++ PresentTag.java 2001/06/11 17:34:40 1.7.2.1
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/logic/PresentTag.java,v
1.7 2001/02/12 21:49:58 craigmcc Exp $
- * $Revision: 1.7 $
- * $Date: 2001/02/12 21:49:58 $
+ * $Header:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/logic/PresentTag.java,v
1.7.2.1 2001/06/11 17:34:40 craigmcc Exp $
+ * $Revision: 1.7.2.1 $
+ * $Date: 2001/06/11 17:34:40 $
*
* ====================================================================
*
@@ -77,7 +77,7 @@
* is present for this request.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.7 $ $Date: 2001/02/12 21:49:58 $
+ * @version $Revision: 1.7.2.1 $ $Date: 2001/06/11 17:34:40 $
*/
public class PresentTag extends ConditionalTagBase {
@@ -133,8 +133,13 @@
getHeader(header);
present = (value != null);
} else if (name != null) {
- Object value =
- RequestUtils.lookup(pageContext, name, property, scope);
+ Object value = null;
+ try {
+ value =
+ RequestUtils.lookup(pageContext, name, property, scope);
+ } catch (JspException e) {
+ value = null;
+ }
present = (value != null);
} else if (parameter != null) {
String value =