This is where JSTL would be a perfect fix:

<bean:define id="theNumber" name="searchStats" property="topHits"
scope="request"/>

<logic:greaterThan name="bean_name" property="property_name"
value="theNumber">
        ...
</logic:greaterThan>

Doesn't make sense but can be done with:

<c:if test="${bean_name.property_name > searchStats.topHits}">
        do something
</c:if>

Or for a 'purer' jstl replace '>' with 'gt' in the above.
-Tim

-----Original Message-----
From: Otto, Frank [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 21, 2003 5:25 AM
To: 'Struts Users Mailing List'
Subject: AW: greaterThan tag


Hi,

you can directly compare:

<bean:define id="theNumber" name="searchStats" property="topHits"
scope="request"/>

<logic:greaterThan name="bean_name" property="property_name"
value="theNumber">
        ...
</logic:greaterThan>


Regards,

Frank

-----Ursprungliche Nachricht-----
Von: mucus snot [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 21. Oktober 2003 11:14
An: [EMAIL PROTECTED]
Betreff: greaterThan tag


Hi,
I am trying to use logic:greaterThan, but comparing a bean property to 
another bean property.
The code that I am using is
<logic:greaterThan name="searchStats" property="numHits" value="     " >
When value is a constant,  the code works.
But when I define a bean <bean:define id="theNumber" name="searchStats" 
property="topHits" scope="request">
and refer to this in the tag value="<%= theNumber %>", it won't compile 
because of a problem with setValue.

error:

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 45 in the jsp file: /results.jsp

Generated servlet error:
     [javac] Compiling 1 source file

C:\dropbox\eclipse\...\results_jsp.java:240: cannot resolve symbol
symbol  : method setValue (java.lang.Object)
location: class org.apache.struts.taglib.logic.GreaterThanTag
           _jspx_th_logic_greaterThan_1.setValue( theNumber );

apologies for not being very adept at debugging jsp

Any help appreciated,
Al  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to