cedric 01/09/17 01:55:51
Modified: contrib/tiles/src/share/org/apache/struts/taglib/tiles
GetTag.java GetAttributeTag.java
Log:
Correct constructor declaration
Correct "null" bug when getting undefined attribute
Revision Changes Path
1.2 +0 -0
jakarta-struts/contrib/tiles/src/share/org/apache/struts/taglib/tiles/GetTag.java
Index: GetTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/contrib/tiles/src/share/org/apache/struts/taglib/tiles/GetTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- GetTag.java 2001/08/01 14:36:40 1.1
+++ GetTag.java 2001/09/17 08:55:51 1.2
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-struts/contrib/tiles/src/share/org/apache/struts/taglib/tiles/GetTag.java,v
1.1 2001/08/01 14:36:40 cedric Exp $
- * $Revision: 1.1 $
- * $Date: 2001/08/01 14:36:40 $
+ * $Header:
/home/cvs/jakarta-struts/contrib/tiles/src/share/org/apache/struts/taglib/tiles/GetTag.java,v
1.2 2001/09/17 08:55:51 cedric Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/09/17 08:55:51 $
* $Author: cedric $
*
*/
1.2 +9 -3
jakarta-struts/contrib/tiles/src/share/org/apache/struts/taglib/tiles/GetAttributeTag.java
Index: GetAttributeTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/contrib/tiles/src/share/org/apache/struts/taglib/tiles/GetAttributeTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- GetAttributeTag.java 2001/08/01 14:36:40 1.1
+++ GetAttributeTag.java 2001/09/17 08:55:51 1.2
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-struts/contrib/tiles/src/share/org/apache/struts/taglib/tiles/GetAttributeTag.java,v
1.1 2001/08/01 14:36:40 cedric Exp $
- * $Revision: 1.1 $
- * $Date: 2001/08/01 14:36:40 $
+ * $Header:
/home/cvs/jakarta-struts/contrib/tiles/src/share/org/apache/struts/taglib/tiles/GetAttributeTag.java,v
1.2 2001/09/17 08:55:51 cedric Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/09/17 08:55:51 $
* $Author: cedric $
*
*/
@@ -22,7 +22,7 @@
* The usual toString() conversions is applied on found value.
*/
public class GetAttributeTag extends TagSupport implements ComponentConstants {
-
+
private String attribute = null;
/** Role attribute */
private String role = null;
@@ -99,8 +99,14 @@
throw new JspException ( "Error - tag.getAsString : component context is not
defined. Check tag syntax" );
Object value = compContext.getAttribute(attribute);
- if( value == null && isErrorIgnored == false )
- throw new JspException ( "Error - tag.getAsString : attribute '"+ attribute +
"' not found in context. Check tag syntax" );
+ if( value == null)
+ { // no value : throw error or fail silently according to ignore
+ if(isErrorIgnored == false )
+ throw new JspException ( "Error - tag.getAsString : attribute '"+ attribute
+ "' not found in context. Check tag syntax" );
+ else
+ return EVAL_PAGE;
+ } // end if
+
try
{