Thanks, but can't make it work, here is my code, must be missing something:

  binder.bind(URLEncoder.class,
MyURLEncoderImpl.class).withId("URLEncoder");

   public static void contributeAliasOverrides(
            @InjectService("URLEncoder") URLEncoder urlencoder,
            Configuration<AliasContribution<?>> configuration) {
      
        configuration.add(
                AliasContribution.create(
                        URLEncoder.class, urlencoder));
    }



Ulrich Stärk wrote:
> 
> I'm sorry. It's not in the ioc documentation but in the alias section of
> the user guide: 
> http://tapestry.apache.org/tapestry5/guide/alias.html
> 
> Uli
> 
> Ulrich Stärk schrieb:
>> Check the tapestry-ioc documentation on how to override a service.
>> 
>> Ui
>> 
>> Angelo Chen schrieb:
>>> Hi,
>>>
>>> I'd like to override the URLEncoder to allow '=' as part of URL, here is
>>> what I did:
>>>
>>>  binder.bind(URLEncoder.class, URLEncoderImpl.class);
>>>
>>> but I got this:
>>> 2009-03-17 23:58:13.215::WARN:  failed app
>>> ava.lang.RuntimeException: Service id 'URLEncoder' has already been 
>>> defined
>>> by org.apache.tapestry5.internal.services.URLEncoderImpl() (at
>>> URLEncoderImpl.java:22) via
>>> org.apache.tapestry5.services.TapestryModule.bind(ServiceBinder) (at
>>> TapestryModule.java:150) and may not be redefined by
>>> org.abx.myapp.t5.services.URLEncoderImpl() (at URLEncoderImpl.java:22) 
>>> via
>>> org.abx.myapp.t5.services.AppModule.bind(ServiceBinder) (at
>>> AppModule.java:42). You should rename one of the service builder
>>> methods.
>>>     at
>>> org.apache.tapestry5.ioc.internal.RegistryImpl.<init>(RegistryImpl.java:170)
>>>  
>>>
>>>
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/t5%3A-overriding-URLEncoder-tp22562519p22563342.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to