craigmcc 02/03/15 21:07:02 Modified: src/share/org/apache/struts/taglib/bean Tag: STRUTS_1_0_BRANCH DefineTag.java LocalStrings.properties Log: Port fix for Bugzilla #6098 (null values for <bean:define>) to 1.0 branch. PR: Bugzilla #6098 Submitted by: Bill Wallace <wayfarer3134 at yahoo.com> Revision Changes Path No revision No revision 1.12.2.1 +22 -5 jakarta-struts/src/share/org/apache/struts/taglib/bean/DefineTag.java Index: DefineTag.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/DefineTag.java,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -u -r1.12 -r1.12.2.1 --- DefineTag.java 23 Apr 2001 22:52:20 -0000 1.12 +++ DefineTag.java 16 Mar 2002 05:07:02 -0000 1.12.2.1 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/DefineTag.java,v 1.12 2001/04/23 22:52:20 craigmcc Exp $ - * $Revision: 1.12 $ - * $Date: 2001/04/23 22:52:20 $ + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/DefineTag.java,v 1.12.2.1 2002/03/16 05:07:02 craigmcc Exp $ + * $Revision: 1.12.2.1 $ + * $Date: 2002/03/16 05:07:02 $ * * ==================================================================== * @@ -68,6 +68,7 @@ import javax.servlet.jsp.JspException; import javax.servlet.jsp.PageContext; import javax.servlet.jsp.tagext.TagSupport; +import org.apache.struts.util.MessageResources; import org.apache.struts.util.RequestUtils; @@ -76,12 +77,21 @@ * bean property. * * @author Craig R. McClanahan - * @version $Revision: 1.12 $ $Date: 2001/04/23 22:52:20 $ + * @version $Revision: 1.12.2.1 $ $Date: 2002/03/16 05:07:02 $ */ public class DefineTag extends TagSupport { + // ---------------------------------------------------- Protected variables + + /** + * The message resources for this package. + */ + protected static MessageResources messages = + MessageResources.getMessageResources + ("org.apache.struts.taglib.bean.LocalStrings"); + // ------------------------------------------------------------- Properties @@ -196,8 +206,15 @@ // Retrieve the required property value Object value = this.value; - if (value == null) + if ((value == null) && (name != null)) { value = RequestUtils.lookup(pageContext, name, property, scope); + } + if (value == null) { + JspException e = + new JspException(messages.getMessage("define.null")); + RequestUtils.saveException(pageContext, e); + throw e; + } // Expose this value as a scripting variable int inScope = PageContext.PAGE_SCOPE; 1.12.2.1 +1 -0 jakarta-struts/src/share/org/apache/struts/taglib/bean/LocalStrings.properties Index: LocalStrings.properties =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/LocalStrings.properties,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -u -r1.12 -r1.12.2.1 --- LocalStrings.properties 9 May 2001 19:31:11 -0000 1.12 +++ LocalStrings.properties 16 Mar 2002 05:07:02 -0000 1.12.2.1 @@ -1,4 +1,5 @@ cookie.get=No cookie {0} was included in this request +define.null=Define tag cannot set a null value header.get=No header {0} was included in this request include.destination=You must specify exactly one of forward, href, or page include.forward=Missing ActionForward entry {0}
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>