I think we can get rid of the chaining setters in classes like
ApplicationSettings. They are very convenient in normal components, so
I wouldn't like to loose those, but their added value is minimal for
things like ApplicationSettings. Do other people agree?

Eelco

On 10/4/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm using a custom IWebApplicationFactory to create a wicket application 
> inside its own Spring application context:
>
> <beans>
>   <bean id="application" class="test.MyApplication">
>     <property name="settings" ref="settings"/>
>     <property name="sessionFactory" ref="sessionFactory"/>
>    </bean>
>
>   <bean id="settings" class="test.MySettings">
>     <constructor-arg ref="application"/>
>     <property name="pageFactory" ref="pageFactory"/>
>   </bean>
>
>   <bean id="pageFactory" class="test.MyPageFactory"/>
>
>   <bean id="sessionFactory" class="test.MySessionFactory">
>     <constructor-arg ref="application"/>
>   </bean>
> </beans>
>
> I've added setSettings() to my application, so that MySettings could be 
> injected into the application.
>
> Now to my problem:
> It seems that Spring does not like Wicket's 'chainable' setters because of 
> their return type, e.g.
>
>   public ApplicationSettings setDefaultPageFactory(IPageFactory 
> defaultPageFactory)
>
> A NotWritablePropertyException will be thrown because of the non-void return 
> type.
>
> After adding setPageFactory() I realized that I have to add a Java-Beans 
> compliant setter for each property of ApplicationSettings, e.g.
>
>   <property name="stripWicketTags" value="true"/>
>
> I'm not sure who is to blame for this, Spring because it's so picky or Wicket 
> with its baroque setter idiom (or perhaps me ;).
>
> Does anybody have a nice solution to this?
>
> Sven
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to