cvs commit: jakarta-struts/web/exercise-taglib html-select.jsp
martinc 2002/10/08 22:09:36 Modified:src/exercise-taglib/org/apache/struts/webapp/exercise ApplicationResources.properties TestBean.java src/share/org/apache/struts/taglib/html OptionTag.java web/exercise-taglib html-select.jsp Log: Check for null bodyContent before attempting to process it. Add a test case to catch this. PR: 13064 Submitted by: Juozas Baliuka Revision ChangesPath 1.3 +8 -0 jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/ApplicationResources.properties Index: ApplicationResources.properties === RCS file: /home/cvs/jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/ApplicationResources.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ApplicationResources.properties 16 Jul 2002 04:56:42 - 1.2 +++ ApplicationResources.properties 9 Oct 2002 05:09:35 - 1.3 @@ -29,3 +29,11 @@ property3message1=Property 3, Message 1 property3message2=Property 3, Message 2 globalMessage=Global Message + +# +# Resources for testing html:option. +# + +resources0=Resources 0 +resources1=Resources 1 +resources2=Resources 2 1.7 +18 -4 jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/TestBean.java Index: TestBean.java === RCS file: /home/cvs/jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/TestBean.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- TestBean.java 12 Mar 2002 06:30:56 - 1.6 +++ TestBean.java 9 Oct 2002 05:09:35 - 1.7 @@ -398,6 +398,20 @@ /** + * A single-String value for a SELECT element based on resource strings. + */ +private String resourcesSelect = Resources 2; + +public String getResourcesSelect() { +return (this.resourcesSelect); +} + +public void setResourcesSelect(String resourcesSelect) { +this.resourcesSelect = resourcesSelect; +} + + +/** * A property that allows a null value but is still used in a SELECT. */ private String withNulls = null; 1.12 +11 -9 jakarta-struts/src/share/org/apache/struts/taglib/html/OptionTag.java Index: OptionTag.java === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/OptionTag.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- OptionTag.java4 Oct 2002 05:34:19 - 1.11 +++ OptionTag.java9 Oct 2002 05:09:35 - 1.12 @@ -262,11 +262,13 @@ */ public int doAfterBody() throws JspException { -String text = bodyContent.getString(); -if (text != null) { -text = text.trim(); -if (text.length() 0) -this.text = text; +if (bodyContent != null) { +String text = bodyContent.getString(); +if (text != null) { +text = text.trim(); +if (text.length() 0) +this.text = text; +} } return (SKIP_BODY); 1.8 +11 -0 jakarta-struts/web/exercise-taglib/html-select.jsp Index: html-select.jsp === RCS file: /home/cvs/jakarta-struts/web/exercise-taglib/html-select.jsp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- html-select.jsp 12 Mar 2002 06:30:56 - 1.7 +++ html-select.jsp 9 Oct 2002 05:09:35 - 1.8 @@ -102,6 +102,17 @@ /tr tr +th align=rightSelect With Labels From Resources:/th +td align=left + html:select property=resourcesSelect size=3 +html:option value=Resources 0 key=resources0/ +html:option value=Resources 1 key=resources1/ +html:option value=Resources 2 key=resources2/ + /html:select +/td + /tr + + tr th align=right Collection with null labels and values: /th -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-struts/web/exercise-taglib html-select.jsp
craigmcc02/03/11 22:30:56 Modified:src/example/org/apache/struts/webapp/example ApplicationResources.properties src/exercise-taglib/org/apache/struts/webapp/exercise TestBean.java src/share/org/apache/struts/util LabelValueBean.java web/example/WEB-INF struts-config.xml web/exercise-taglib html-select.jsp Log: Add a test case to the struts-exercise-taglib webapp for html:options with null labels and values. Make LabelValueBean serializable so that it doesn't cause problems when the exercise webapp is saved and reloaded on a container that tries to save and restore session attributes (like Tomcat 4). Correct the Struts example webapp to conform to the new rule that the exception element must include a key attribute. Revision ChangesPath 1.4 +1 -0 jakarta-struts/src/example/org/apache/struts/webapp/example/ApplicationResources.properties Index: ApplicationResources.properties === RCS file: /home/cvs/jakarta-struts/src/example/org/apache/struts/webapp/example/ApplicationResources.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ApplicationResources.properties 31 Dec 2001 01:14:36 - 1.3 +++ ApplicationResources.properties 12 Mar 2002 06:30:56 - 1.4 @@ -25,6 +25,7 @@ errors.footer=/ulhr errors.header=h3font color=redValidation Error/font/h3You must correct the following error(s) before proceeding:ul errors.ioException=I/O exception rendering error messages: {0} +expired.password=User Password has expired heading.autoConnect=Auto heading.subscriptions=Current Subscriptions heading.host=Host Name 1.6 +18 -4 jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/TestBean.java Index: TestBean.java === RCS file: /home/cvs/jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/TestBean.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- TestBean.java 23 Feb 2002 07:10:30 - 1.5 +++ TestBean.java 12 Mar 2002 06:30:56 - 1.6 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/TestBean.java,v 1.5 2002/02/23 07:10:30 martinc Exp $ - * $Revision: 1.5 $ - * $Date: 2002/02/23 07:10:30 $ + * $Header: /home/cvs/jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/TestBean.java,v 1.6 2002/03/12 06:30:56 craigmcc Exp $ + * $Revision: 1.6 $ + * $Date: 2002/03/12 06:30:56 $ * * * @@ -76,7 +76,7 @@ * * @author Craig R. McClanahan * @author Martin F N Cooper - * @version $Revision: 1.5 $ $Date: 2002/02/23 07:10:30 $ + * @version $Revision: 1.6 $ $Date: 2002/03/12 06:30:56 $ */ public class TestBean extends ActionForm { @@ -394,6 +394,20 @@ public void setEmptyStringProperty(String emptyStringProperty) { this.emptyStringProperty = emptyStringProperty; +} + + +/** + * A property that allows a null value but is still used in a SELECT. + */ +private String withNulls = null; + +public String getWithNulls() { +return (this.withNulls); +} + +public void setWithNulls(String withNulls) { +this.withNulls = withNulls; } 1.2 +8 -5 jakarta-struts/src/share/org/apache/struts/util/LabelValueBean.java Index: LabelValueBean.java === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/util/LabelValueBean.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- LabelValueBean.java 8 Nov 2001 03:34:39 - 1.1 +++ LabelValueBean.java 12 Mar 2002 06:30:56 - 1.2 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/util/LabelValueBean.java,v 1.1 2001/11/08 03:34:39 martinc Exp $ - * $Revision: 1.1 $ - * $Date: 2001/11/08 03:34:39 $ + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/util/LabelValueBean.java,v 1.2 2002/03/12 06:30:56 craigmcc Exp $ + * $Revision: 1.2 $ + * $Date: 2002/03/12 06:30:56 $ * * * @@ -63,6 +63,9 @@ package org.apache.struts.util; +import java.io.Serializable; + + /** * A simple JavaBean to represent label-value pairs. This is most commonly used * when constructing user interface elements which have a label to be displayed @@ -71,10 +74,10 @@ * * @author
Re: cvs commit: jakarta-struts/web/exercise-taglib html-select.jsp
Martin, Can I get a simple example bean and markup of its various options, so I can see how I have to get it nested?... Ta. Arron. [EMAIL PROTECTED] wrote: martinc 02/02/22 23:10:30 Modified:doc/userGuide struts-html.xml src/exercise-taglib/org/apache/struts/webapp/exercise TestBean.java src/share/org/apache/struts/taglib/html LocalStrings.properties web/exercise-taglib html-select.jsp Added: src/share/org/apache/struts/taglib/html OptionsCollectionTag.java Log: Add new html:optionsCollection tag, as discussed last November. I don't particularly like the tag name, but I couldn't think of anything better. Revision ChangesPath 1.2 +421 -1jakarta-struts/doc/userGuide/struts-html.xml Index: struts-html.xml === RCS file: /home/cvs/jakarta-struts/doc/userGuide/struts-html.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- struts-html.xml 20 Feb 2002 00:41:14 - 1.1 +++ struts-html.xml 23 Feb 2002 07:10:30 - 1.2 @@ -3430,7 +3430,7 @@ element. This tag can be used multiple times within a single codelt;html:selectgt;/code element, either in conjunction with or instead of one or more codelt;html:optiongt;/code -elements./p +or codelt;html:optionsCollectiongt;/code elements./p pThis tag operates in one of two major modes, depending on whether or not the codecollection/code attribute is @@ -3570,6 +3570,426 @@ rtexprvaluetrue/rtexprvalue info CSS stylesheet class to be applied to this HTML element. +/info +/attribute +/tag + +tag + +nameoptionsCollection/name +summary +Render a Collection of Select Options +/summary +tagclassorg.apache.struts.taglib.html.OptionsCollectionTag/tagclass +bodycontentempty/bodycontent +info +pRenders a set of HTML codelt;optiongt;/code elements, +representing possible choices for a codelt;selectgt;/code +element. This tag can be used multiple times within a single +codelt;html:selectgt;/code element, either in conjunction +with or instead of one or more codelt;html:optiongt;/code +or codelt;html:optionsgt;/code elements./p + +pThis tag operates on a collection of beans, where each bean +has a stronglabel/strong property and a strongvalue/strong +property. The actual names of these properties can be configured +using the codelabel/code and codevalue/code attributes +of this tag./p + +pThis tag differs from the codelt;html:optionsgt;/code tag +in that it makes more consistent use of the codename/code and +codeproperty/code attributes, and allows the collection to be +more easily obtained from the enclosing form bean./p +/info + +attribute +namelabel/name +requiredfalse/required +rtexprvaluetrue/rtexprvalue +info +The property of the bean within the collection which represents +the label to be rendered for each option. Defaults to label. +/info +/attribute + +attribute +namename/name +requiredfalse/required +rtexprvaluetrue/rtexprvalue +info +The attribute name of the bean whose properties are consulted +when rendering the current value of this input field. If not +specified, the bean associated with the form tag we are nested +within is utilized. +/info +/attribute + +attribute +nameproperty/name +requiredtrue/required +rtexprvaluetrue/rtexprvalue +info +The property of the form bean, or the bean specified by the name +attribute, that will return the collection of objects to be +rendered for these options. +/info +/attribute + +attribute +namestyle/name +requiredfalse/required +rtexprvaluetrue/rtexprvalue +info +CSS styles to be applied to this HTML element. +/info +/attribute + +attribute +namestyleClass/name +requiredfalse/required +rtexprvaluetrue/rtexprvalue +info
Re: cvs commit: jakarta-struts/web/exercise-taglib html-select.jsp
Arron, I modified the html:select test in struts-exercise-taglib to include a simple example of how this tag is used, and I modified the TestBean class for that test as well. I also checked in the docs for the tag, so you'll see them if you build struts-documentation. If you need more than that, just let me know exactly what you need. -- Martin Cooper - Original Message - From: Arron Bates [EMAIL PROTECTED] To: Struts Developers List [EMAIL PROTECTED] Sent: Saturday, February 23, 2002 12:50 AM Subject: Re: cvs commit: jakarta-struts/web/exercise-taglib html-select.jsp Martin, Can I get a simple example bean and markup of its various options, so I can see how I have to get it nested?... Ta. Arron. [EMAIL PROTECTED] wrote: martinc 02/02/22 23:10:30 Modified:doc/userGuide struts-html.xml src/exercise-taglib/org/apache/struts/webapp/exercise TestBean.java src/share/org/apache/struts/taglib/html LocalStrings.properties web/exercise-taglib html-select.jsp Added: src/share/org/apache/struts/taglib/html OptionsCollectionTag.java Log: Add new html:optionsCollection tag, as discussed last November. I don't particularly like the tag name, but I couldn't think of anything better. Revision ChangesPath 1.2 +421 -1jakarta-struts/doc/userGuide/struts-html.xml Index: struts-html.xml === RCS file: /home/cvs/jakarta-struts/doc/userGuide/struts-html.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- struts-html.xml 20 Feb 2002 00:41:14 - 1.1 +++ struts-html.xml 23 Feb 2002 07:10:30 - 1.2 @@ -3430,7 +3430,7 @@ element. This tag can be used multiple times within a single codelt;html:selectgt;/code element, either in conjunction with or instead of one or more codelt;html:optiongt;/code -elements./p +or codelt;html:optionsCollectiongt;/code elements./p pThis tag operates in one of two major modes, depending on whether or not the codecollection/code attribute is @@ -3570,6 +3570,426 @@ rtexprvaluetrue/rtexprvalue info CSS stylesheet class to be applied to this HTML element. +/info +/attribute +/tag + +tag + +nameoptionsCollection/name +summary +Render a Collection of Select Options +/summary + tagclassorg.apache.struts.taglib.html.OptionsCollectionTag/tagclass +bodycontentempty/bodycontent +info +pRenders a set of HTML codelt;optiongt;/code elements, +representing possible choices for a codelt;selectgt;/code +element. This tag can be used multiple times within a single +codelt;html:selectgt;/code element, either in conjunction +with or instead of one or more codelt;html:optiongt;/code +or codelt;html:optionsgt;/code elements./p + +pThis tag operates on a collection of beans, where each bean +has a stronglabel/strong property and a strongvalue/strong +property. The actual names of these properties can be configured +using the codelabel/code and codevalue/code attributes +of this tag./p + +pThis tag differs from the codelt;html:optionsgt;/code tag +in that it makes more consistent use of the codename/code and +codeproperty/code attributes, and allows the collection to be +more easily obtained from the enclosing form bean./p +/info + +attribute +namelabel/name +requiredfalse/required +rtexprvaluetrue/rtexprvalue +info +The property of the bean within the collection which represents +the label to be rendered for each option. Defaults to label. +/info +/attribute + +attribute +namename/name +requiredfalse/required +rtexprvaluetrue/rtexprvalue +info +The attribute name of the bean whose properties are consulted +when rendering the current value of this input field. If not +specified, the bean associated with the form tag we are nested +within is utilized. +/info +/attribute + +attribute +nameproperty/name +requiredtrue/required +rtexprvaluetrue/rtexprvalue +info
cvs commit: jakarta-struts/web/exercise-taglib html-select.jsp
martinc 02/02/22 23:10:30 Modified:doc/userGuide struts-html.xml src/exercise-taglib/org/apache/struts/webapp/exercise TestBean.java src/share/org/apache/struts/taglib/html LocalStrings.properties web/exercise-taglib html-select.jsp Added: src/share/org/apache/struts/taglib/html OptionsCollectionTag.java Log: Add new html:optionsCollection tag, as discussed last November. I don't particularly like the tag name, but I couldn't think of anything better. Revision ChangesPath 1.2 +421 -1jakarta-struts/doc/userGuide/struts-html.xml Index: struts-html.xml === RCS file: /home/cvs/jakarta-struts/doc/userGuide/struts-html.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- struts-html.xml 20 Feb 2002 00:41:14 - 1.1 +++ struts-html.xml 23 Feb 2002 07:10:30 - 1.2 @@ -3430,7 +3430,7 @@ element. This tag can be used multiple times within a single codelt;html:selectgt;/code element, either in conjunction with or instead of one or more codelt;html:optiongt;/code -elements./p +or codelt;html:optionsCollectiongt;/code elements./p pThis tag operates in one of two major modes, depending on whether or not the codecollection/code attribute is @@ -3570,6 +3570,426 @@ rtexprvaluetrue/rtexprvalue info CSS stylesheet class to be applied to this HTML element. +/info +/attribute +/tag + +tag + +nameoptionsCollection/name +summary +Render a Collection of Select Options +/summary +tagclassorg.apache.struts.taglib.html.OptionsCollectionTag/tagclass +bodycontentempty/bodycontent +info +pRenders a set of HTML codelt;optiongt;/code elements, +representing possible choices for a codelt;selectgt;/code +element. This tag can be used multiple times within a single +codelt;html:selectgt;/code element, either in conjunction +with or instead of one or more codelt;html:optiongt;/code +or codelt;html:optionsgt;/code elements./p + +pThis tag operates on a collection of beans, where each bean +has a stronglabel/strong property and a strongvalue/strong +property. The actual names of these properties can be configured +using the codelabel/code and codevalue/code attributes +of this tag./p + +pThis tag differs from the codelt;html:optionsgt;/code tag +in that it makes more consistent use of the codename/code and +codeproperty/code attributes, and allows the collection to be +more easily obtained from the enclosing form bean./p +/info + +attribute +namelabel/name +requiredfalse/required +rtexprvaluetrue/rtexprvalue +info +The property of the bean within the collection which represents +the label to be rendered for each option. Defaults to label. +/info +/attribute + +attribute +namename/name +requiredfalse/required +rtexprvaluetrue/rtexprvalue +info +The attribute name of the bean whose properties are consulted +when rendering the current value of this input field. If not +specified, the bean associated with the form tag we are nested +within is utilized. +/info +/attribute + +attribute +nameproperty/name +requiredtrue/required +rtexprvaluetrue/rtexprvalue +info +The property of the form bean, or the bean specified by the name +attribute, that will return the collection of objects to be +rendered for these options. +/info +/attribute + +attribute +namestyle/name +requiredfalse/required +rtexprvaluetrue/rtexprvalue +info +CSS styles to be applied to this HTML element. +/info +/attribute + +attribute +namestyleClass/name +requiredfalse/required +rtexprvaluetrue/rtexprvalue +info +CSS stylesheet class to be applied to this HTML element. +/info +/attribute + +attribute +
cvs commit: jakarta-struts/web/exercise-taglib html-select.jsp
martinc 02/02/20 21:48:10 Modified:web/exercise-taglib html-select.jsp Log: Fixed a problem introduced by calling ActionForm.reset() when the FormTag instantiates the associated form bean. The initial values for the tests were not showing up. Revision ChangesPath 1.5 +13 -0 jakarta-struts/web/exercise-taglib/html-select.jsp Index: html-select.jsp === RCS file: /home/cvs/jakarta-struts/web/exercise-taglib/html-select.jsp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- html-select.jsp 13 Jan 2002 00:25:37 - 1.4 +++ html-select.jsp 21 Feb 2002 05:48:10 - 1.5 @@ -35,6 +35,19 @@ is redisplayed. Press Save to update, or Cancel to return to the main menu. +%-- + Ensure that the form bean exists before the form tag is processed. This + is a simple (if not entirely clean) way of ensuring that the initial + values assigned during bean instantiation will be available within the + form, since reset() will not be called when the form bean already exists. + + The right way to fix this is to modify this webapp so that it does not + refer directly to JSP pages, but goes through Action classes, and to + either modify the TestBean class, adding an initialize() method, or to + have an Action class set the initial values. +--% +jsp:useBean id=testbean scope=session class=org.apache.struts.webapp.exercise.TestBean/ + html:form action=html-select.do table border=0 width=100% -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-struts/web/exercise-taglib html-select.jsp
martinc 01/10/14 22:50:11 Modified:src/exercise-taglib/org/apache/struts/webapp/exercise TestBean.java web/exercise-taglib html-select.jsp Added: src/exercise-taglib/org/apache/struts/webapp/exercise OptionBean.java Log: Added test case for html:select using html:options based on a collection saved in the page context. Revision ChangesPath 1.4 +20 -4 jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/TestBean.java Index: TestBean.java === RCS file: /home/cvs/jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/TestBean.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TestBean.java 2001/07/08 04:15:12 1.3 +++ TestBean.java 2001/10/15 05:50:10 1.4 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/TestBean.java,v 1.3 2001/07/08 04:15:12 martinc Exp $ - * $Revision: 1.3 $ - * $Date: 2001/07/08 04:15:12 $ + * $Header: /home/cvs/jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/TestBean.java,v 1.4 2001/10/15 05:50:10 martinc Exp $ + * $Revision: 1.4 $ + * $Date: 2001/10/15 05:50:10 $ * * * @@ -72,7 +72,7 @@ * General purpose test bean for Struts custom tag tests. * * @author Craig R. McClanahan - * @version $Revision: 1.3 $ $Date: 2001/07/08 04:15:12 $ + * @version $Revision: 1.4 $ $Date: 2001/10/15 05:50:10 $ */ public class TestBean extends ActionForm { @@ -96,6 +96,21 @@ /** + * A multiple-String SELECT element using a collection. + */ +private String[] collectionSelect = { Value 2, Value 4, + Value 6 }; + +public String[] getCollectionSelect() { +return (this.collectionSelect); +} + +public void setCollectionSelect(String collectionSelect[]) { +this.collectionSelect = collectionSelect; +} + + +/** * A double property. */ private double doubleProperty = 321.0; @@ -340,6 +355,7 @@ public void reset(ActionMapping mapping, HttpServletRequest request) { booleanProperty = false; +collectionSelect = new String[0]; intMultibox = new int[0]; multipleSelect = new String[0]; stringMultibox = new String[0]; 1.1 jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/OptionBean.java Index: OptionBean.java === /* * $Header: /home/cvs/jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/OptionBean.java,v 1.1 2001/10/15 05:50:10 martinc Exp $ * $Revision: 1.1 $ * $Date: 2001/10/15 05:50:10 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names The Jakarta Project, Struts, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS
cvs commit: jakarta-struts/web/exercise-taglib html-select.jsp
martinc 01/10/14 22:56:22 Modified:src/exercise-taglib/org/apache/struts/webapp/exercise Tag: STRUTS_1_0_BRANCH TestBean.java web/exercise-taglib Tag: STRUTS_1_0_BRANCH html-select.jsp Added: src/exercise-taglib/org/apache/struts/webapp/exercise Tag: STRUTS_1_0_BRANCH OptionBean.java Log: Added test case for html:select using html:options based on a collection saved in the page context. Revision ChangesPath No revision No revision 1.2.2.1 +20 -4 jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/TestBean.java Index: TestBean.java === RCS file: /home/cvs/jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/TestBean.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- TestBean.java 2001/05/04 21:49:27 1.2 +++ TestBean.java 2001/10/15 05:56:22 1.2.2.1 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/TestBean.java,v 1.2 2001/05/04 21:49:27 craigmcc Exp $ - * $Revision: 1.2 $ - * $Date: 2001/05/04 21:49:27 $ + * $Header: /home/cvs/jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/TestBean.java,v 1.2.2.1 2001/10/15 05:56:22 martinc Exp $ + * $Revision: 1.2.2.1 $ + * $Date: 2001/10/15 05:56:22 $ * * * @@ -72,7 +72,7 @@ * General purpose test bean for Struts custom tag tests. * * @author Craig R. McClanahan - * @version $Revision: 1.2 $ $Date: 2001/05/04 21:49:27 $ + * @version $Revision: 1.2.2.1 $ $Date: 2001/10/15 05:56:22 $ */ public class TestBean extends ActionForm { @@ -96,6 +96,21 @@ /** + * A multiple-String SELECT element using a collection. + */ +private String[] collectionSelect = { Value 2, Value 4, + Value 6 }; + +public String[] getCollectionSelect() { +return (this.collectionSelect); +} + +public void setCollectionSelect(String collectionSelect[]) { +this.collectionSelect = collectionSelect; +} + + +/** * A double property. */ private double doubleProperty = 321.0; @@ -327,6 +342,7 @@ public void reset(ActionMapping mapping, HttpServletRequest request) { booleanProperty = false; +collectionSelect = new String[0]; intMultibox = new int[0]; multipleSelect = new String[0]; stringMultibox = new String[0]; No revision No revision 1.1.2.1 +0 -0 jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/OptionBean.java Index: OptionBean.java === RCS file: /home/cvs/jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/OptionBean.java,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- OptionBean.java 2001/10/15 05:50:10 1.1 +++ OptionBean.java 2001/10/15 05:56:22 1.1.2.1 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/OptionBean.java,v 1.1 2001/10/15 05:50:10 martinc Exp $ - * $Revision: 1.1 $ - * $Date: 2001/10/15 05:50:10 $ + * $Header: /home/cvs/jakarta-struts/src/exercise-taglib/org/apache/struts/webapp/exercise/OptionBean.java,v 1.1.2.1 2001/10/15 05:56:22 martinc Exp $ + * $Revision: 1.1.2.1 $ + * $Date: 2001/10/15 05:56:22 $ * * * @@ -68,7 +68,7 @@ * in conjunction with the codecollection/code attribute. * * @author Martin F N Cooper - * @version $Revision: 1.1 $ $Date: 2001/10/15 05:50:10 $ + * @version $Revision: 1.1.2.1 $ $Date: 2001/10/15 05:56:22 $ */ public class OptionBean { No revision No revision 1.1.2.1 +23 -1 jakarta-struts/web/exercise-taglib/html-select.jsp Index: html-select.jsp === RCS file: /home/cvs/jakarta-struts/web/exercise-taglib/html-select.jsp,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- html-select.jsp 2001/03/07 04:50:54 1.1 +++ html-select.jsp 2001/10/15 05:56:22 1.1.2.1 @@ -1,4 +1,4 @@ -%@ page language=java% +%@ page language=java import=java.util.*, org.apache.struts.webapp.exercise.*;% %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@