When you just use the maven archetype for starting a project everything works right out of the box.
2009/9/24 cleverpig <greatclever...@gmail.com> > it's exactly,you should have a Logger service when tapestry startup.. > > but if i comment this function in AppModule,i would miss Logger service: > public Logger buildLogger(final Logger log){ > return log; > } > > After commented,it was only 3 service about logging in service list > when app startup: > ... > LoggerSource: BUILTIN > LoggingAdvisor: DEFINED > LoggingDecorator: DEFINED > ... > so strange.. > > 2009/9/24 Alfonso Quiroga <alfonsose...@gmail.com>: > > Cleverpig: > > In my AppModule and ServerModule (I have 2 modules) I have nothing > > related to logging. I only have "bindings" between services interfaces > > and implementations, then I have request filters (hibernate filter), > > and finally I have advisors for services (this is like spring > > interceptors, but without XML's :) > > > > In my-package.base, I have "BasePage" where I have: > > > > (import org.slf4j.Logger) > > @Inject private Logger logger; > > > > and that's all, I can use that logger (it has getter) in every page > > (all of my pages extends BasePage) and it works out of the box, I > > don't have to bind anything in modules. Hope it helps > > > > 2009/9/23 cleverpig <greatclever...@gmail.com>: > >> hi,Alfonso! > >> > >> please show me what's in your AppModule..let me get the reality... > >> > >> 2009/9/23 Alfonso Quiroga <alfonsose...@gmail.com>: > >>> Is your logging working now? I didn't do anything in AppModule, just > >>> drop the jars and logging works, if you still have problems, I can > >>> show you my project configuration, good luck > >>> > >>> 2009/9/23 cleverpig <greatclever...@gmail.com>: > >>>> so,after add the buildLogger function,we can use these code to inject > >>>> Logger service: > >>>> > >>>> Class Start{ > >>>> ... > >>>> @Inject > >>>> private Logger log; > >>>> ... > >>>> } > >>>> > >>>> On Wed, Sep 23, 2009 at 12:29 PM, cleverpig <greatclever...@gmail.com> > wrote: > >>>>> I got the answer! It's so easy...thank all of my helpers and > opensource! > >>>>> > >>>>> my problem's solution:add this function in AppModule class: > >>>>> > >>>>> public Logger buildLogger(final Logger log){ > >>>>> return log; > >>>>> } > >>>>> > >>>>> I'd read this article: > http://java.dzone.com/news/tapestry-5-ioc-binding-and-bui,and > >>>>> learned what's the secret & key in there: > >>>>> > >>>>> ---Service Builder Methods--- > >>>>> > >>>>> Sometimes just instantiating a class is not enough; there may be > >>>>> additional configuration needed as part of instantiating the class. > >>>>> Tapestry 5 IoC's predecessor, HiveMind, accomplished such goals with > >>>>> complex service-building services. It ended up being a lot of XML. > >>>>> > >>>>> T5 IoC accomplishes the same, and more, using service builder > methods; > >>>>> module methods that construct a service. A typical case is when a > >>>>> service implementation needs to listen to events from some other > >>>>> service: > >>>>> > >>>>> public static TranslatorSource > >>>>> buildTranslatorSource(ComponentInstantiatorSource > >>>>> componentInstantiatorSource, > >>>>> ServiceResources resources) > >>>>> { > >>>>> TranslatorSourceImpl service = > >>>>> resources.autobuild(TranslatorSourceImpl.class); > >>>>> componentInstantiatorSource.addInvalidationListener(service); > >>>>> return service; > >>>>> } > >>>>> > >>>>> Module methods prefixed with "build" are service builder methods. The > >>>>> service interface is defined from the return value > (TranslatorSource). > >>>>> The service id is explicitly "TranslatorSource" (that is, everything > >>>>> after "build" in the method name). > >>>>> > >>>>> Here, Tapestry has injected into the service builder method. > >>>>> ComponentInstantiatorSource is a service that fires events. > >>>>> ServiceResources is something else: it is a bundle of resources > >>>>> related to the service being constructed ... including the ability to > >>>>> instantiate an object including dependencies. What's great here is > >>>>> that buildTranslatorSource() doesn't need to know what the > >>>>> dependencies of TranslatorSourceImpl are, it can instantiate the > class > >>>>> with dependencies using the autobuild() method. The service builder > >>>>> then adds the new service as a listener of the > >>>>> ComponentInstantiatorSource, before returning it. > >>>>> > >>>>> > >>>>> 2009/9/23 cleverpig <greatclever...@gmail.com>: > >>>>>> yes,i'd read it..but i can't get the door to answer... > >>>>>> > >>>>>> On Wed, Sep 23, 2009 at 9:57 AM, Thiago H. de Paula Figueiredo > >>>>>> <thiag...@gmail.com> wrote: > >>>>>>> Em Tue, 22 Sep 2009 21:55:44 -0300, cleverpig < > greatclever...@gmail.com> > >>>>>>> escreveu: > >>>>>>> > >>>>>>>> oh,thanks for your reply,Alfonso! > >>>>>>>> just now,i get know i need a slf4j implementation.i found a > >>>>>>>> implementation class from > slf4j.jar:org.slf4j.impl.Log4jLoggerAdapter. > >>>>>>>> but how to declare the binding of them? what's need to add in the > >>>>>>>> AppModule? > >>>>>>> > >>>>>>> Take a look at > >>>>>>> http://tapestry.apache.org/tapestry5.1/tapestry-ioc/service.html. > >>>>>>> > >>>>>>> -- > >>>>>>> Thiago H. de Paula Figueiredo > >>>>>>> Independent Java consultant, developer, and instructor > >>>>>>> http://www.arsmachina.com.br/thiago > >>>>>>> > >>>>>>> > --------------------------------------------------------------------- > >>>>>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > >>>>>>> For additional commands, e-mail: users-h...@tapestry.apache.org > >>>>>>> > >>>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> -- > >>>>>> cleverpig(Dan) > >>>>>> Location: Beijing > >>>>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China > >>>>>> Zipcode: 100031 > >>>>>> MSN: great_liu...@hotmail.com > >>>>>> QQ: 149291732 > >>>>>> Skype: cleverpigatmatrix > >>>>>> Facebook ID:cleverpig > >>>>>> Blog: www.cleverpig.name > >>>>>> Tags: del.icio.us/cleverpig > >>>>>> Twitter: twitter.com/cleverpig > >>>>>> 新浪微博: t.sina.com.cn/cleverpig > >>>>>> Organization: www.beijing-open-party.org > >>>>>> or...@facebook: http://www.facebook.com/group.php?gid=8159558294 > >>>>>> > >>>>> > >>>>> > >>>>> > >>>>> -- > >>>>> cleverpig(Dan) > >>>>> Location: Beijing > >>>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China > >>>>> Zipcode: 100031 > >>>>> MSN: great_liu...@hotmail.com > >>>>> QQ: 149291732 > >>>>> Skype: cleverpigatmatrix > >>>>> Facebook ID:cleverpig > >>>>> Blog: www.cleverpig.name > >>>>> Tags: del.icio.us/cleverpig > >>>>> Twitter: twitter.com/cleverpig > >>>>> 新浪微博: t.sina.com.cn/cleverpig > >>>>> Organization: www.beijing-open-party.org > >>>>> or...@facebook: http://www.facebook.com/group.php?gid=8159558294 > >>>>> > >>>> > >>>> > >>>> > >>>> -- > >>>> cleverpig(Dan) > >>>> Location: Beijing > >>>> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China > >>>> Zipcode: 100031 > >>>> MSN: great_liu...@hotmail.com > >>>> QQ: 149291732 > >>>> Skype: cleverpigatmatrix > >>>> Facebook ID:cleverpig > >>>> Blog: www.cleverpig.name > >>>> Tags: del.icio.us/cleverpig > >>>> Twitter: twitter.com/cleverpig > >>>> 新浪微博: t.sina.com.cn/cleverpig > >>>> Organization: www.beijing-open-party.org > >>>> or...@facebook: http://www.facebook.com/group.php?gid=8159558294 > >>>> > >>>> --------------------------------------------------------------------- > >>>> 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 > >>> > >>> > >> > >> > >> > >> -- > >> cleverpig(Dan) > >> Location: Beijing > >> Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China > >> Zipcode: 100031 > >> MSN: great_liu...@hotmail.com > >> QQ: 149291732 > >> Skype: cleverpigatmatrix > >> Facebook ID:cleverpig > >> Blog: www.cleverpig.name > >> Tags: del.icio.us/cleverpig > >> Twitter: twitter.com/cleverpig > >> 新浪微博: t.sina.com.cn/cleverpig > >> Organization: www.beijing-open-party.org > >> or...@facebook: http://www.facebook.com/group.php?gid=8159558294 > >> > >> --------------------------------------------------------------------- > >> 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 > > > > > > > > -- > cleverpig(Dan) > Location: Beijing > Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China > Zipcode: 100031 > MSN: great_liu...@hotmail.com > QQ: 149291732 > Skype: cleverpigatmatrix > Facebook ID:cleverpig > Blog: www.cleverpig.name > Tags: del.icio.us/cleverpig > Twitter: twitter.com/cleverpig > 新浪微博: t.sina.com.cn/cleverpig > Organization: www.beijing-open-party.org > or...@facebook: http://www.facebook.com/group.php?gid=8159558294 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >