struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: Custom OGNL PropertyAccessor
Date Tue, 05 Feb 2008 18:17:54 GMT
Tommy Becker wrote:
> I have a question about using OGNL PropertyAccessors.  We have an object 
> on the value stack that we expose to JSP pages that does not have 
> standard JavaBeans getter/setter methods.  From what I can tell, this 
> leaves us 2 options.  We can either call the getter methods explicitly 
> via OGNL method calls in the pages, or we can wrap the object in a 
> JavaBean-like object.  The second option is unworkable in all but the 
> simplest of cases when you realize that the method calls can themselves 
> return another object that needs to be wrapped, or even a collection of 
> them.  So we've been using method calls in the pages (yeah I know).
> 
> Reading through the OGNL docs, it seems that what we need is a 
> PropertyAccessor that knows how to operate on our object.  So we 
> implemented one, and attempted to register it by placing this in our 
> struts.xml:
> 
> <bean type="ognl.PropertyAccessor" name="class.we.need.access.to" 
> class="our.property.accessor.PropertyAccessor"/>
> 
> Unfortunately it doesn't work.  Can someone tell me what we're doing 
> wrong, or even if what we're trying to do is possible?  Thanks!

I don't know anything about OGNL's PropertyAccessor, but I doubt anyone 
can offer much help without seeing the code and a better description of 
the failure than "it doesn't work."

L.


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


Mime
View raw message