…and if you worry about having too many annotations in the constructor, you can also omit the @Inject annoation for symbols in recent Tapestry versions (I think > 5.2).
@Symbol(SymbolConstants.PRODUCTION_MODE) boolean productionMode Am 22.07.2012 um 15:34 schrieb Lance Java: > You can use @Inject, @Value and @Symbol in tapestry services. @Property can > only be used in pages and components, NOT services. > > The following should work in a service: > > @Inject @Symbol("tapestry.production-mode") > private boolean productionMode; > > You could also do this: > > @Inject @Value("${tapestry.production-mode}") > private boolean productionMode; > > I never use private field injection in my services (@Inject) as it makes it > difficult to test but the option is there if you want it. > > > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/Test-if-production-or-test-mode-tp5714658p5714674.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 > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org