tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Duffy <duff...@yahoo.com>
Subject Re: Logic:Equal Question.
Date Thu, 08 May 2003 17:24:00 GMT

I think the JavaBean idiom for boolean values uses
"boolean isXXX()/void setXXX(boolean v)" instead of
"Object getXXX()/void setXXX(Object o)".  See Chapter
13, page 288 of Marty Hall's "Core Java Servlets and
JSPs".

I'll bet the JSP is assuming that the boolean getter
is of the form "isXXX()" and can't find it.  I'm not
100% certain, though.

"hasResults" sure does sound nice.  What is the "is"
equivalent: "isResultLaden()"?  "isFullOResults()"? 
;)  Maybe "isInitialized()" would work.

--- John De Lello <JohnD@DelWare.com> wrote:
> 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-beans>
>         <form-bean
>             name="paymentReviewForm"
>            
> type="com.vwks.ing.form.VWDynaValidatorForm">
>             <form-property name="source"           
> type="java.lang.String"
> initial="I"/>
>             <form-property name="name"             
> type="java.lang.String"
> />
>         </form-bean>
>     </form-beans>
> 
>     <action-mappings>
>        <action path="/PaymentReviewDispatchAction"
>  
>
type="com.vwks.ing.action.payment.PaymentReviewDispatchAction"
>                   scope="request"
>                   name="paymentReviewForm"
>                   validate="false"
>                   parameter="dispatchTo">
>                   <forward name="display"
> path="/web/payment/paymentReview.jsp"/>
>                   <forward name="search"
> path="/web/payment/paymentReview.jsp"/>
>           </action>
>     </action-mappings>
> 
> In my dispatch action class I am doing this:
> 
> 
> 
>         	VWDynaValidatorForm vwForm =
> (VWDynaValidatorForm) form;
> 	// a whole unch of other stuff..
> 
>           	vwForm.setHasResults(false);
> 	
> 	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
> criteria.</td></tr>
> 	</logic:equal>
> 
> 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
> John
> 
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

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


Mime
View raw message