I never saw any comment on this in struts-user.  Perhaps it is better for 
struts-dev.


Mike

>Date: Mon, 26 Feb 2001 11:18:38 MST
>From: "Michael McCallister (r2126c)" <[EMAIL PROTECTED]>
>Subject: logic:present Property Oddity?
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Apparently-To: "Michael_McCallister-R2126C@email" <r2126c@msgphx8>
>X-Motorola-Sent-Wireless: 1
>
>I'm using the logic:present tag to avoid displaying a section of a 
>html:form if a particular bean is missing.  Given the documentation, I expected
>
>     <logic:present scope="session" name="myBean" property="myProperty">
>
>to behave something like this (in pseudocode):
>
>     if (session.getAttribute("myBean") != null &&
>         session.getAttribute("myBean").getMyProperty() != null)
>                 // Display the body of the logic:present tag
>
>but instead, it seems to behave like this:
>
>     if (session.getAttribute("myBean").getMyProperty() != null)
>                 // Display the body of the logic:present tag
>
>The problem this causes is that if I specify a property and my session 
>bean doesn't exist, I get a ServletException that complains "Cannot find 
>bean myBean in scope session".  In order to get the behavior I expect, it 
>looks like I have to nest some logic:present tags like this:
>
>     <logic:present scope="session" name="myBean">
>         <logic:present scope="session" name="myBean" property="myProperty">
>
>Which, of course, looks unnecessarily redundant.  Is this behavior as 
>intended, or is this a bug?  If the behavior changed to the form I 
>expected, would this cause any existing user code to break?
>
>
>Mike
>
>____________________________________
>Mike McCallister

Reply via email to