craigmcc 02/03/15 17:47:14
Modified: src/share/org/apache/struts/taglib/logic PresentTag.java
Log:
Refine the code used by <logic:present> and <logic:notPresent> to not
introduce a bogus exception (which gets saved as a request attribute) as part
of determining the presence or absence of a bean.
PR: Bugzilla #7097
Submitted by: Gidado-Yisa Immanuel <avm3 at cdc.gov>
Revision Changes Path
1.11 +10 -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.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- PresentTag.java 20 Jul 2001 23:34:04 -0000 1.10
+++ PresentTag.java 16 Mar 2002 01:47:14 -0000 1.11
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/logic/PresentTag.java,v
1.10 2001/07/20 23:34:04 mschachter Exp $
- * $Revision: 1.10 $
- * $Date: 2001/07/20 23:34:04 $
+ * $Header:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/logic/PresentTag.java,v
1.11 2002/03/16 01:47:14 craigmcc Exp $
+ * $Revision: 1.11 $
+ * $Date: 2002/03/16 01:47:14 $
*
* ====================================================================
*
@@ -78,7 +78,7 @@
* is present for this request.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.10 $ $Date: 2001/07/20 23:34:04 $
+ * @version $Revision: 1.11 $ $Date: 2002/03/16 01:47:14 $
*/
public class PresentTag extends ConditionalTagBase {
@@ -138,8 +138,12 @@
} else if (name != null) {
Object value = null;
try {
- value =
- RequestUtils.lookup(pageContext, name, property, scope);
+ if (property != null) {
+ value = RequestUtils.lookup(pageContext, name,
+ property, scope);
+ } else {
+ value = RequestUtils.lookup(pageContext, name, scope);
+ }
} catch (JspException e) {
value = null;
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>