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 00:53:28 UTC

Re: logic:greaterEqual tag

Ted Husted wrote:

> > I don't have to specify, for example, <html:text id="myBean"
> property="myText">, i can just say <html:text property="myText">..
> shouldn't the logic tags follow this model by default?
>
> I think here the logic tags are following the general bean-tag model by
> default.
>
> In the case of the HTML tag there is an implicit, default
> name="[formbean]" parameter to the <html:form> tags, which is then made
> the default name parameter to the tags nested within the form. Of
> course, you can override this in either case by supplying another name
> parameter.
>
> I'm actually surprised that you were able to use the greaterEqual tag
> without a name parameter. I hadn't realized the logic tags were
> consulting the action mappings now.
>

They aren't.  As you point out above, the logic tags need to work even
outside a form in order to be generally useful.

In the oroginal scenario, if "resultsAvailable" is a bean itself (say, in
request scope), you can access it like this:

    <logic:greaterEqual name="resultsAvailable" value="1">
        ... display results here ...
    </logic:greaterEqual>

If you wanted to access the *property* of a bean for your test, you would
use both name and property together:

    <logic:greaterEqual name="mybean" property="resultsAvailable"
        value="1">

Craig