I'd need to see your java code to figure out why there was a problem.
On 1/30/06, Martin Carel <[EMAIL PROTECTED]> wrote:
> Hi!
>
> Thanks for the feedback Raul. It worked fine with the @InjectState
> annotation. I still don't understand why I got this "duplicate method"
> error in the first place, but I need to move on...
>
> It's so nice to have such an active mailing-list.
>
> /M
>
> Raul Raja Martinez wrote:
> > If you can use Java 5 the easiest way to access an ASO and bind it to
> > a property is:
> >
> > @InjectState("placeHolder")
> > public abstract com.data.DO getPlaceHolder();
> >
> > now you can use it in your page with ognl with:
> >
> > ognl:placeHolder
> >
> > or simply
> >
> > placeHolder
> >
> >
> > if you can use annotations you don't have to use <inject> at all
> >
> > best regards
> >
> > Raul Raja.
> >
> >
> > Martin Carel wrote:
> >> Hi!
> >>
> >> I have this in hivemodule.xml:
> >>
> >> <contribution configuration-id="tapestry.state.ApplicationObjects">
> >> <state-object name="placeHolder" scope="session">
> >> <create-instance class="com.data.DO"/>
> >> </state-object>
> >> </contribution>
> >>
> >> And I have this in my page's spec:
> >>
> >> <page-specification class="com.pages.myPage">
> >> <inject property="myProp" type="state" object="placeHolder"/>
> >> </page-specification>
> >>
> >> Then, in my page (if I do not define any accessors), if I call
> >> getMyProp(), I get a compiler error complaining about the unknown
> >> method (no surprise there). But when I do add the accessors methods,
> >> at runtime I get an ApplicationRuntimeException "unable to add method
> >> [...] duplicate method". There's a little something I'm missing here,
> >> as per the doc it is possible to inject a property AND define
> >> accessors for it within my page.
> >>
> >> So in order to move forward, I turned to using Hivemind directly:
> >> DO holder = (DO)PropertyUtils.read(this, "myProp");
> >> or
> >> DO holder = (DO)PropertyUtils.read(this, "placeHolder");
> >> and then in both cases I get a runtime exception saying it cannot
> >> find my property :(
> >>
> >> Yay. Any hints would be appreciated.
> >>
> >> /Martin
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
Professional Tapestry training, mentoring, support
and project work. http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]