You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "Craig R. McClanahan" <Cr...@eng.sun.com> on 2000/06/13 23:31:32 UTC

Custom Tag Attribute Names

One comment I've heard is that the attribute "name" is used in Struts
somewhat inconsistently (both internal to Struts and as compared to
other tags like <jsp:getProperty>).  What would you think of using the
attribute "name" when you are talking about a JavaBean in some
appropriate scope, and use "property" when you are talking about a
property of that bean?

Doing this, you would do something like this for the login page of the
example application:

    <struts:form ... name="logonForm" ...>
        ...
        <struts:text property="username" .../>
        ....
    </struts:form>

instead of the current approach:

    <struts:form ... name="logonForm" ...>
        ...
        <struts:text name="username" .../>
        ....
    </struts:form>

What do you think?

Craig



Re: Custom Tag Attribute Names

Posted by "Hutchison, Jeff" <jh...@inst.strykercorp.com>.
On Tue, 13 Jun 2000, Craig R. McClanahan wrote:

> One comment I've heard is that the attribute "name" is used in Struts
> somewhat inconsistently (both internal to Struts and as compared to
> other tags like <jsp:getProperty>).  What would you think of using the
> attribute "name" when you are talking about a JavaBean in some
> appropriate scope, and use "property" when you are talking about a
> property of that bean?
> 
> Doing this, you would do something like this for the login page of the
> example application:
> 
>     <struts:form ... name="logonForm" ...>
>         ...
>         <struts:text property="username" .../>
>         ....
>     </struts:form>
> 
> instead of the current approach:
> 
>     <struts:form ... name="logonForm" ...>
>         ...
>         <struts:text name="username" .../>
>         ....
>     </struts:form>
> 
> What do you think?

Good idea, it's consistent with the concept and makes it easier to think
of forms in the correct "struts" way.
 
> Craig


-jh

-- 
Jeff Hutchison <jh...@inst.strykercorp.com>
Stryker Instruments Kalamazoo, MI