tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <Wendy.Sm...@asu.edu>
Subject RE: JSTL and boolean Attributes ???
Date Wed, 22 Jan 2003 16:35:21 GMT
Leif wrote:
> i want to access a boolean attribute through JSTL. 
> If my class looks like:
> class Checker {
> 	private boolean m_isValid = false;
> 
> 	public void setValid( boolean p_isValid ) {
> 		m_isValid = p_isValid;
> 	}
> 
> 	public boolean isValid() {
> 		return m_isValid;
> 	}
> }
> it seems that JSTL can not access my field:
> <c:out value="${checker.valid}"/>
> Correct? If so, why can't JSTL handle that?

Interesting.  You appear to conform to the JavaBeans spec (section 8.3.2)
which says that you can have an isValid method either instead of or in
addition to getValid.  Certainly changing isValid to getValid should fix it,
but I think it ought to work as is.  

Out of curiosity, have you tried <c:out value="${checker.isValid}"/> ?
Maybe it will recognise the 'is' prefix and not turn it into getIsValid.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message