You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ha...@belgium.agfa.com on 2001/03/20 11:06:17 UTC

struts tags

Hi,

Can anybody help me as soon as possible with the following questions :

1. Readonly text field :
     How do I create a readonly input text form field, using the struts tag
"html:text" ?
     A standard html tag <input type="text"> can have the readonly attribute
set, but this does not seem to exist
     for the corresponding struts tag "html:text".

2. Populating beans :
    Using struts html tags, a form field is coupled to a bean property.
    When only "property" is specified, the field is coupled to a property of the
corresponding form bean.
    When "name" and "property" are specified, the field can be coupled to a
property of another bean.

    However, when the form is submitted, the form field value will only be put
automatically into the corresponding property
    in case of using a form bean. In case of using another bean than a form
bean, the property
    is not set automatically (I have to populate this other bean myself).
   That means that the coupling of form fields to other beans than form beans
    only works in the get-direction (properties are consulted for rendering the
form fields), not in the set-direction.
    Why this asymmetrical behaviour ?

3. Sometimes I need form fields with a name, to be used by JavaScript, but
without coupling them to a bean property.
    Hence I created form fields with a "property" specified, which does not
exist in the form bean.
    I would expect that this should work, not setting any (non existent)
property in the form bean.
    But I get : javax.servlet.ServletException: runtime failure in custom tag
'form'

H. Franken,
software engineer at Agfa n.v.