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

Reply via email to