I believe the original thought was that, looking forward, there will be
more and more support for JavaBeans in development tools, and that
ActionForms will eventually have to interact with drag-and-drop GUIs,
which would need to know what properties the class is ~suppose~ to have
prior to runtime. 

Going with Maps, as opposed to JavaBean accessors, would change a number
of things at a fundamental level. It would not be a trivial exercise,
unless there was some way to create an automagic BeanInfo wrapper around
the Map. 

Though, something to try might be an alternate set of html tags that
expected an ActionMap [an ActionForm subclass with Map getMap(),
setMap(Map map), set(String key, String property), and String get(String
key) methods]. 

The tags could look for get("property") instead of getProperty(), and a
subclassed ActionServlet could populate the Map instead.

Not sure what would have to be done to get something like the
ValidatorForm to work with this arrangement.

But, personally, I'm good with the JavaBeans ;-)

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/struts/


> > -----Original Message-----
> > From: Daniel Aborg [mailto:[EMAIL PROTECTED]]
> > Sent: vrijdag 9 november 2001 16:53
> > To: Struts Users Mailing List
> > Subject: Re: Using a Map like a bean?
> >
> >
> > Thanks, that worked just fine.
> >
> > I do think that it's a good suggestion for future development
> > to make it
> > possible to mix Maps and beans in the struts tags.
> >
> > /Daniel
> >
> >
> > Tom Klaasen (TeleRelay) wrote:
> >
> > > I think the best way to go is to write some very thin bean wrappers
> > > around your maps: have a look at BeanUtils.describe() and
> > > BeanUtils.populate(). Should be very doable imho.
> > >
> > >>-----Original Message-----
> > >>I'm working on a project which we're developing using
> > struts 1.0, and
> > >>have just ran into a problem. Our business logic is using
> > >>both Maps and
> > >>beans to represent the data, and I can't find a way to access Map
> > >>properties in struts.
> >
> >
> > --
> > Daniel Aborg - Developer  <[EMAIL PROTECTED]>
> > M: +44 (0)7720 29 44 40  DDI: +44 (0)20 7451 1447
> > Netengines: +44 (0)20 7451 1444  <www.netengines.com>
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:struts-user-> [EMAIL PROTECTED]>
> > For
> > additional commands,
> > e-mail: <mailto:[EMAIL PROTECTED]>
> >
> >
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to