You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2001/10/21 19:00:52 UTC

Bug report for Struts [2001/10/21]

+---------------------------------------------------------------------------+
| Bugzilla Bug ID                                                           |
|     +---------------------------------------------------------------------+
|     | Status: UNC=Unconfirmed NEW=New         ASS=Assigned                |
|     |         OPN=Reopened    VER=Verified    (Skipped Closed/Resolved)   |
|     |   +-----------------------------------------------------------------+
|     |   | Severity: BLK=Blocker     CRI=Critical    MAJ=Major             |
|     |   |           MIN=Minor       NOR=Normal      EHN=Ehnancement       |
|     |   |   +-------------------------------------------------------------+
|     |   |   | Date Posted                                                 |
|     |   |   |          +--------------------------------------------------+
|     |   |   |          | Description                                      |
|     |   |   |          |                                                  |
|  866|New|Enh|2001-03-06|Clean Way to Add Parameters to Redirecting Forward|
|  905|New|Enh|2001-03-08|Need new mode for html:options for single Collecti|
|  931|New|Enh|2001-03-11|Struts needs to cleanly support running multiple c|
| 1467|New|Enh|2001-04-23|Enhancement requested for HIDDEN tag/ alternaive t|
| 1481|New|Enh|2001-04-24|Enhanced resolution of collection property in html|
| 1586|Opn|Nor|2001-05-01|The <html:form> tag generates incorrect focus java|
| 1683|New|Enh|2001-05-09|Change Struts tags to be more granular in their de|
| 1797|New|Enh|2001-05-17|Add a way to write out &nbsp; if data is null     |
| 1817|New|Enh|2001-05-18|Nested property lookup should understand Maps     |
| 1826|New|Enh|2001-05-20|Dynamic Properties (instead of using the Reflectio|
| 1871|New|Enh|2001-05-23|tag that displays iterate tag index value         |
| 1895|New|Enh|2001-05-24|Provide a way to specify xerces and xalan in build|
| 1896|New|Enh|2001-05-24|Store copies of the TLD files in CVS              |
| 2017|Ass|Maj|2001-06-05|Text entered in forms using multi-part/formdata ca|
| 2046|Opn|Enh|2001-06-07|a struts tag within another struts tag            |
| 2096|New|Enh|2001-06-09|Change <html:options/> to use a collection like <l|
| 2116|New|Enh|2001-06-11|OptionsTag and SelectTag (small refactor) proposed|
| 2164|New|Enh|2001-06-13|add per item header and footer to ErrorsTag       |
| 2214|New|Maj|2001-06-18|ActionServlet uses double-check idiom which is bro|
| 2265|New|Enh|2001-06-21|additional constructor for ActionError            |
| 2513|New|Nor|2001-07-09|Options tag does not work as documented           |
| 2601|Unc|Enh|2001-07-12|Request http filter for MessageResources          |
| 2679|New|Nor|2001-07-18|iterate tag problem                               |
| 2757|New|Nor|2001-07-23|file upload problem: MultipartIterator: invalid mu|
| 3190|New|Nor|2001-08-20|FORM tag doesn't handle all cases of servlet mappi|
| 3202|New|Enh|2001-08-21|OptionsTag.doEndTag -> calls method to populate se|
| 3212|New|Blk|2001-08-21|Somehow encrypting the data-source password       |
| 3239|New|Nor|2001-08-22|tag properties not exposed to iterator index      |
| 3251|New|Nor|2001-08-23|Struts  on AIX   (Websphere 3.5.3)                |
| 3281|New|Nor|2001-08-27|rewrite uses responseUtils.filter                 |
| 3283|New|Enh|2001-08-27|Adding Multiple Match Logic Equal/notEqual Tags   |
| 3337|New|Maj|2001-08-29|Application scope objects being cached by tags.   |
| 3353|New|Enh|2001-08-29|Need More Flexibility Setting/Getting ActionForm P|
| 3465|New|Nor|2001-09-06|FormFile.destroy() doesn't work for temporary file|
| 3485|New|Enh|2001-09-07|How to Chain action                               |
| 3539|New|Nor|2001-09-10|UTF-16 format character decode error when html-for|
| 3702|Opn|Cri|2001-09-18|File Upload mangles files                         |
| 3737|New|Nor|2001-09-19|Unable to handle multiple spaces in Struts Bean - |
| 3783|Unc|Nor|2001-09-23|Uploading MacIntosh files                         |
| 3789|New|Enh|2001-09-24|ID= attribute                                     |
| 3828|New|Maj|2001-09-25|Out of Bounds Exception on File Upload            |
| 3849|New|Enh|2001-09-26|Enhance template tag to conditionally get contents|
| 3852|New|Enh|2001-09-27|Generated HTML should be well-formed              |
| 3959|New|Enh|2001-10-03|Resource Properties, Connection Pool              |
| 4028|New|Nor|2001-10-08|html:radio current value should be converted to st|
| 4095|New|Nor|2001-10-11|html:select should take default value from the pro|
| 4132|New|Enh|2001-10-12|possible problem with GenericDataSource.close     |
| 4170|New|Nor|2001-10-15|MaxLengthExceeded doesn't stop file upload        |
| 4174|New|Min|2001-10-15|PropertyUtils.setSimpleProperty throws exception o|
| 4258|New|Nor|2001-10-18|Can't upload big-sized file that doesn't have 0x0a|
+-----+---+---+----------+--------------------------------------------------+
| Total   50 bugs                                                           |
+---------------------------------------------------------------------------+

Re: Select tag (was: Bug report for Struts [2001/10/21])

Posted by ma...@tumbleweed.com.
Unless I'm misunderstanding you, the <html:select> tag works this way
already.

You can see this if you look at the struts-exercise-taglib.war application
bundled with Struts. It uses <html:select> in exactly the way you indicate -
with 'property' and without 'value' - and the initial selected value
corresponds to the value of the property.

You can also see this if you look at the code in SelectTag.doStartTag(),
where it says (abbreviating somewhat for clarity):

    if (value != null) {
        match = value;
    } else {
        Object bean = pageContext.findAttribute(name);
        match = BeanUtils.getSimpleProperty(bean, property);
    }

where 'match' is the value used to determine which item is initially
selected.

--
Martin Cooper


----- Original Message -----
From: "Joe Faith" <fa...@runtime-collective.com>
To: <st...@jakarta.apache.org>
Sent: Monday, October 22, 2001 1:29 AM
Subject: Re: Bug report for Struts [2001/10/21]


> bugzilla@apache.org wrote:
>
> | 4095|New|Nor|2001-10-11|html:select should take default value from the
> pro|
>
> I was planning to write a patch for this, but wanted to check the
> functionality with you guys first.
>
> The problem is that <html:select> fields don't inherit their default
> option from the corresponding form property. Unless you hard-code a
> default value (or use a jsp work-around) the select box defaults to the
> option at the top of the options list. The solution that fits most
> easily with existing struts functionality would be:
>
>
>     if 'property' tag attribute is set and 'value' isn't then set the
> html 'value' attribute to the current form property value.
>
>
> In other words, you can still override the current form property with a
> hard-code default option if you want to.
>
>
> The problem with this solution is that it is not *quite* backwards
> compatible: in particular, those pages that currently use a
> <html:select> without specifying a default value will find the option
> defaulting to the current property value, rather that the option at the
> top of the list.
>
>
> So is the current behaviour a bug that needs eliminating, or a
> much-loved 'feature' that needs preserving?
>
>
> --
>
>
> Joe Faith
>
>
> Runtime Collective, Ltd <http://www.runtime-collective.com>
> T: (+44) 01273 234294
>
>
>



Re: Bug report for Struts [2001/10/21]

Posted by Joe Faith <fa...@runtime-collective.com>.
bugzilla@apache.org wrote:

> | 4095|New|Nor|2001-10-11|html:select should take default value from the pro|

I was planning to write a patch for this, but wanted to check the functionality
with you guys first.

The problem is that <html:select> fields don't inherit their default option from
the corresponding form property. Unless you hard-code a default value (or use a
jsp work-around) the select box defaults to the option at the top of the options
list. The solution that fits most easily with existing struts functionality
would be:

    if 'property' tag attribute is set and 'value' isn't then set the html
'value' attribute to the current form property value.

In other words, you can still override the current form property with a
hard-code default option if you want to.

The problem with this solution is that it is not *quite* backwards
compatible: in particular, those pages that currently use a
<html:select> without specifying a default value will find the option defaulting
to the current property value, rather that the option at the top of the list.

So is the current behaviour a bug that needs eliminating, or a much-loved
'feature' that needs preserving?

--

Joe Faith

Runtime Collective, Ltd
T: (+44) 01273 234294