You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alex Colic <al...@pop-ware.com> on 2001/06/05 22:08:34 UTC

Please help with logic notPresent

Hi,

I have an object in the session that if it is not there I want to display
and error msg to the user. My error code is as follows:

<logic:notPresent name="VendorResourceList" scope="session">
  <font color="red">
    <bean:message key="error.fatal" />
  </font>
</logic:notPresent>

I would think that the above code would show the message if the
"VendorResourceList" object is not found in the session but the error msg
is always displayed even though the below code snippet works.

<TABLE>
  <TR>
    <TD>
      <bean:message key="prompt.vendorNumber"/>
    </TD>
    <TD>
    <logic:present name="VendorResourceList" scope="session">
	I am here
   </logic:present >
   </TD>

Amy help in understanding this is appreciated.

Alex

Re: Please help with logic notPresent

Posted by Ted Husted <hu...@apache.org>.
Be sure you've included the logic tld. The "I am here" would display
regardless, since the browsers ignore tags they don't understand. 

Alex Colic wrote:
> 
> Hi,
> 
> I have an object in the session that if it is not there I want to display
> and error msg to the user. My error code is as follows:
> 
> <logic:notPresent name="VendorResourceList" scope="session">
>   <font color="red">
>     <bean:message key="error.fatal" />
>   </font>
> </logic:notPresent>
> 
> I would think that the above code would show the message if the
> "VendorResourceList" object is not found in the session but the error msg
> is always displayed even though the below code snippet works.
> 
> <TABLE>
>   <TR>
>     <TD>
>       <bean:message key="prompt.vendorNumber"/>
>     </TD>
>     <TD>
>     <logic:present name="VendorResourceList" scope="session">
>         I am here
>    </logic:present >
>    </TD>
> 
> Amy help in understanding this is appreciated.
> 
> Alex