struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Brown <Stephen.Br...@servador.com>
Subject RE: bean:write and c:out only takes proper javabeans?
Date Wed, 09 Jul 2003 17:05:15 GMT
The only way to do this is the use getter and setter methods with JavaBean
naming conventions.  This should in no way interfere with a Corba backend,
Corba can be used pretty much just like EJB.  The tags use reflection, but
just to find appropriately named getter methods - the Java conventions say
to make the fields private, you should follow the base Java conventions
http://java.sun.com/docs/codeconv/.

> -----Original Message-----
> From: henrik.bentel@teradyne.com [mailto:henrik.bentel@teradyne.com]
> Sent: July 9, 2003 12:08 PM
> To: struts-user@jakarta.apache.org
> Subject: bean:write and c:out only takes proper javabeans?
> 
> 
> Does the bean write tag and the c:out tag (JSTL) only accept 
> object that
> adhere to the Javabean specification?
> 
> I have objects with public fields(no getter or setter) and 
> objects inside
> objects all public(again no getter or setter).
> But if I try to do somthing like(in JSTL) <C:out value="
> ${resultBean.intMember}"/> where intMember is just a public 
> int field, I
> get the following exception:
> org.apache.jasper.JasperException: An error occurred while evaluating
> custom action attribute "value" with value "${resultBean.intMember}":
> Unable
> to find a value for "intMember" in object of class 
> "beantest.testBean1"
> using
> operator "." (null)
>          at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServlet
> Wrapper.java:254)
> 
> 
> Yes, idealy I should use proper javabeans, but in this case 
> my struts app
> is interfacing with a CORBA based backend, and all result-structures
> comming back are IDLEntities with public fields(the backend is an old
> C-based app with nothing but heavily nested enums and structs 
> and whatnot.
> ).
> 
> So my assumption was that the tags used reflection on fields 
> so I could
> just write value="${result.innerResult.wayInnerResult.innerLong}"
> Are there any ways of doing this?
> 
> thanks
> Henrik Bentel
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

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