tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen, Gin" <>
Subject RE: Logic:Equal Question.
Date Thu, 08 May 2003 17:54:23 GMT
In case what I posted wasnt very clear:
I believe the logic tag does something like:

paymentReviewForm.get("hasResults"); and that is not going to work as
hasResults in not actually in the mapping for paymentReviewForm.

Does that make sense? I'm a bit tired right now and therefore not too
articulate :P
Let me know if I should explain it a bit more.

-----Original Message-----
From: Chen, Gin []
Sent: Thursday, May 08, 2003 1:51 PM
To: 'Tag Libraries Users List'
Subject: RE: Logic:Equal Question.

I don't think the error is in the way that your invoking it but rather it is
a feature of struts.
In struts. DynaForms are maps. So that a property such as hasResults etc is
actually in a map with key of hasResults and value. Therefore DynaForms
never need getters and setters.
So I wonder if the logic tag realizes that and is therefore going to the map
for hasResults rather than following the standard javabean logic.
As a way to test it. Change your logic statement (dont forget the closing
tag) to:
<c:if test="${not paymentReviewForm.hasResults}">

Since c is a jstl tag and is not part of the struts framework. it will still
try to do standard javabean conventions on your dynaform bean.

-----Original Message-----
From: John De Lello []
Sent: Thursday, May 08, 2003 12:18 PM
Subject: Logic:Equal Question.

Hi Everyone,

I extended DynaValidatorForm to a class called "VWDynaValidatorForm" and I
added a protected boolean called "hasResults" I also added a setter and
getter for this property. The getter is called "getHasResults()"

My struts config file looks like:

            <form-property name="source"            type="java.lang.String"
            <form-property name="name"              type="java.lang.String"

       <action path="/PaymentReviewDispatchAction"
                  <forward name="display"
                  <forward name="search"

In my dispatch action class I am doing this:

        	VWDynaValidatorForm vwForm = (VWDynaValidatorForm) form;
	// a whole unch of other stuff..

	return mapping.findForward("search");

Now, in my JSP I need to conditionally display some text based on where
"hasResults" is set to true or not. Here is what I am trying to do:

	<logic:equal value="false" name="paymentReviewForm"
property="hasResults" scope="request">
            	<tr align='center' bgcolor="#FFFFFF"><td colspan='4'
class="whiteResults"><br>No records were found matching your

This generates the following error:
	javax.servlet.ServletException: Exception accessing property
hasResults for bean paymentReviewForm: java.lang.NoSuchMethodException:
Unknown property 'hasResults' 

How do I tell the logic tag to access the "getHasResults" method that is in
my extended class??

Thank you

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message