dmkarr 2002/10/24 22:28:46 Modified: src/share/org/apache/struts/taglib/bean SizeTag.java Log: Fixed reference to "LocalStrings" file. It was pointing to the "logic" file, not the "bean" file. Added "size.noCollectionOrName" exception indicating that either "collection" or "name" attribute has to be set. Revision Changes Path 1.4 +16 -6 jakarta-struts/src/share/org/apache/struts/taglib/bean/SizeTag.java Index: SizeTag.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/SizeTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- SizeTag.java 22 Sep 2002 06:32:46 -0000 1.3 +++ SizeTag.java 25 Oct 2002 05:28:46 -0000 1.4 @@ -121,7 +121,7 @@ */ protected static MessageResources messages = MessageResources.getMessageResources - ("org.apache.struts.taglib.logic.LocalStrings"); + ("org.apache.struts.taglib.bean.LocalStrings"); @@ -179,8 +179,18 @@ // Retrieve the required property value Object value = this.collection; - if (value == null) + if (value == null) { + if (name == null) { + // Must specify either a collection attribute or a name + // attribute. + JspException e = new JspException + (messages.getMessage("size.noCollectionOrName")); + RequestUtils.saveException(pageContext, e); + throw e; + } + value = RequestUtils.lookup(pageContext, name, property, scope); + } // Identify the number of elements, based on the collection type int size = 0;
-- To unsubscribe, e-mail: <mailto:struts-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org>