Kris,

Thanks for the help.

Jim.
----- Original Message -----
From: "Kris Schneider" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, August 04, 2003 8:46 PM
Subject: Re: [OT] Digester question


> A bit out of my comfort zone on this one, but I think you might have to
change
> your XML to something like:
>
> <config attr1="someText" attr2="someText">
>   <saveAs>someText</savaAs>
> </config>
>
> because the FactoryCreateRule/ObjectCreationFactory stuff seems to work
with an
> element's attributes, not its sub-elements. Then it looks like you need to
> subclass AbstractObjectCreationFactory and provode a createObject method
impl
> that will extract the appropriate attribute values and construct your
> Configuration object. I'm sure other folks on the list (or on
commons-user) have
> more experience with this though...
>
> Quoting Jim Collins <[EMAIL PROTECTED]>:
>
> > Appologies for the off topic question. Does anyone know how I can create
an
> > object with a constructor that takes agruments specified via XML
elements.
> >
> > I have a Configuration object with a constructor that takes two String
> > parameters. The XML will be something like this:
> >
> > <config>
> >     <param1>someText</param1>
> >     <param2>someText</param2>
> >     <saveAs>someText</savaAs>
> > </config>
> >
> > When the digester matches the config pattern it will create the
> > Configuration object passing param1 and param2 as parameters to the
> > constructor and then when it matches the pattern config/saveAs it will
call
> > a method on the Configuration object.
> >
> > I have looked at the documentation and have seen the FactoryCreateRule
but
> > I
> > am not sure how to use this and how I can get it to use the param1 and
> > param2 elements as the Constructor parameters.
> >
> > Once again sorry for the off topic post. Any hints would be appreciated.
> >
> > Thanks
> >
> > Jim.
>
> --
> Kris Schneider <mailto:[EMAIL PROTECTED]>
> D.O.Tech       <http://www.dotech.com/>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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

Reply via email to