You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Shing Hing Man <ma...@yahoo.com> on 2007/08/11 23:36:47 UTC
T5.0.5 : binder.bind passes service id to serivce class contructor
I have tried to construct a service using binder.bind
:
binder.bind(IGreeting.class,
DefaultGreeting.class).withId("myGreeting");
Here is the service interface and service class:
public interface IGreeting {
public String getGreeting();
}
===========
public class DefaultGreeting implements IGreeting {
private String greeting="Hello World";
public DefaultGreeting(){};
public DefaultGreeting(String msg)
{
greeting=msg;
}
public String getGreeting() {
return greeting;
}
public void setGreeting(String greeting) {
this.greeting = greeting;
}
}
=================
When binder.bind is called, the contructor
public DefaultGreeting(String msg)
is called with msg=myGreeting.
Is this the correct behavior ? I was expecting the
no argument contructor to be called.
Shing
Home page : http://www.lombok.demon.co.uk/
___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org