You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Nathan Hoh <na...@redback.com.au> on 2002/08/27 10:33:32 UTC

Very strange bean behaviour

I'm getting really weird behaviour with a bean that I'm using in a JSP 
page. This bean has 2 Date properties (there are others but they work fine):
	private Date fromDate;
	private Date endDate;

that have the corresponding get & set methods:
	public String getFromDate() {...}
	public String getToDate() {...}

Basically, these methods return the date in a nicely formatted string 
representation.

The problem is, when I try to use <jsp:getProperty name="beanName" 
property="fromDate"/> and <jsp:getProperty name="beanName" 
property="toDate/>, Tomcat gives me an error saying no such method in 
bean of class "au.com....". Yet, if I change the method names 
getFromDate()->getFrogDate() and getToDate()->getTogDate() and use 
<jsp:getProperty name="beanName" property="frogDate"/> and 
<jsp:getProperty name="beanName" property="togDate"/>, everything works 
fine.

If I keep the method name as they were but instead return a Date object 
instead of a String, it also works fine.

WHAT THE H*LL IS GOIN ON?? Are there any reserved words like fromDate or 
something that you can't use??

Confused and going mental,
Nathan.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>