Title: RE: nested logic:present tags do not short-circuit

Hi Ted-

Thanks for the reply. But note that I am really looking at the case where _B_ may be null. I would have wanted the test present name="A" property="B" to prevent the evaluation of the test present name="A" property="B.property". _A_ is never null (or it would be a system error if A were null, so I can't see how adding a test for present name="A" will help me. It will pass this test, it will fail the next test, but then will still try to evaluate the third test (in your example) and show an exception from null pointer dereference.

S-

> -----Original Message-----
> From: Ted Husted [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 15, 2001 6:38 AM
> To: [EMAIL PROTECTED]
> Subject: Re: nested logic:present tags do not short-circuit
>
>
> The first tags says if A.B is not null rather than if A && B are not
> null.
>
> You may need to use more nesting, maybe something like
>
>   <logic:present name="A">
>     <logic:present name="A" property="B">
>       <logic:present name="A" property="B.property">
>              some jsp/html
>         </logic:present>
>      </logic:present>
>    </logic:present>
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
>
>
> > Steve Salkin wrote:
> >
> > Hi-
> >
> > Am I correct to say that in the case of nested <logic:present> tags,
> > the false evaluation of the first one will not "short-circuit", or
> > prevent the evaluation of, the second one?
> >
> > For example, in the case that a Form has a Bean A, which
> itself has a
> > Bean B, and when B is null, the following:
> >   <logic:present name="A" property="B">
> >     <logic:present name="A" property="B.property">
> >       some jsp/html
> >     </logic:present>
> >   </logic:present>
> >
> > will still fail because the second logic tag is evaluated and the
> > null-pointer is dereferenced.
> >
> > If this is correct, is this by design? Is this a bug? Is there a way
> > to accomplish what I am trying to do here?
> >
> > Any thoughts appreciated.
> >
> > Thanks,
> >
> > S-
>

Reply via email to