You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Craig R. McClanahan" <Cr...@eng.sun.com> on 2001/02/01 01:32:04 UTC

Re: logic:greaterEqual tag (also logic:iterate with Arrays thread)

Pete Black wrote:

> Does anybody know whether this will be the preferred method of accessing
> bean methods using logic tags in Struts?
>
> It seems a little confusing that you have to know the names of the bean you
> are using when you use logic:xxx tags, but not with html:xxx tags.
>
> If it counts for anything, my vote would be to keep the default case in all
> the tags consistent - when there is no name parameter defined, the property
> tag refers to the bean bound to the current action in struts-config.xml. It
> makes things clean and magical like they should be.
>
> Is the current behaviour set in stone for version 1?
>

Consider a case where the Struts example application uses a conditional tag
outside the scope of an <html:form> tag -- the check for which type of
transaction is being performed at the top of "registration.jsp" in several
places, including when creating the <title> element:

    <logic:equal name="registrationForm" property="action"
            scope="request" value="Create">
        <title><bean:message key="registration.title.create"/></title>
    </logic:equal>

If the name attribute were not entered here, I don't see how the tag could know
what bean you are referring to.

It would be feasible to make an assumption that, if you're inside a form, then
you must be talking about the form bean -- although that risks confusion as
well because the tag would behave quite differently depending on where it was
placed.

>
> Thanks
>
> -Pete
>

Craig McClanahan