You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pe...@materna.de on 2005/08/19 13:00:55 UTC

logic:lessThan problem

Hi list!

I have some problems comparing values with logic tags. I have searched the
mailing list archive,
but I only found solutions that look pretty the same as what I have done,
but it still does not
work. So perhaps someone can help. I have a bean which stores a list of
projects. Because
the size of this list can vary, I get it like this:

<bean:size id="projectListSize" name="myBean" property="projectList" />

When I write out the size bean <bean:write name="projectListSize" />, the
correct size is shown. But when I try to do the following:

<logic:lessThan name="projectListSize" value="5">
	Less than 5!
</logicLessThan>
<logic:greaterEqual name="projectListSize" value="5">
	Greater or equal 5!
</logic:greaterEqual>

always both messages are shown! Is there something I am missing?

Thanks,
Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: logic:lessThan problem

Posted by Glenn DeschĂȘnes <ma...@gmail.com>.
Hi Peter,

There seems to be a typo in the closing tag.
<logic:lessThan name="projectListSize" value="5">
		 Less than 5!
</logicLessThan>

Should be 
</logic:lessThan>

- Glenn

On 8/19/05, Peter.Zoche@materna.de <Pe...@materna.de> wrote:
> Hi list!
> 
> I have some problems comparing values with logic tags. I have searched the
> mailing list archive,
> but I only found solutions that look pretty the same as what I have done,
> but it still does not
> work. So perhaps someone can help. I have a bean which stores a list of
> projects. Because
> the size of this list can vary, I get it like this:
> 
> <bean:size id="projectListSize" name="myBean" property="projectList" />
> 
> When I write out the size bean <bean:write name="projectListSize" />, the
> correct size is shown. But when I try to do the following:
> 
> <logic:lessThan name="projectListSize" value="5">
>         Less than 5!
> </logicLessThan>
> <logic:greaterEqual name="projectListSize" value="5">
>         Greater or equal 5!
> </logic:greaterEqual>
> 
> always both messages are shown! Is there something I am missing?
> 
> Thanks,
> Peter
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: logic:lessThan problem

Posted by James Neville <ja...@babcockbrown.com>.
Peter,

I'm no expert in the logic tags, preferring standard JSTL.

><logic:lessThan name="projectListSize" value="5">
>	Less than 5!
></logicLessThan>
><logic:greaterEqual name="projectListSize" value="5">
>	Greater or equal 5!
></logic:greaterEqual>
>
>always both messages are shown! Is there something I am missing?
>  
>
However, if the list size is 5, then both will be shown.

Sorry if i'm stating the obvious ;)

As Glenn just said, it may be the typo, but I thought that would also 
produce JSP errors.

James.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org