Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for change notification.
The "Tapestry5HowToCreateAConfigureableService" page has been changed by DanielCaldeweyher. http://wiki.apache.org/tapestry/Tapestry5HowToCreateAConfigureableService?action=diff&rev1=2&rev2=3 -------------------------------------------------- Scenario: you are developing a shopping cart and want to test your app against the sandbox PayPal NVPServer, without having to hard-code the variables into your implementation: - Note: This examples assumes you can read symbols from properties files (see Tapestry5HowToReadSymbolsFromPropertiesFile). Also it uses the [[http://paypal-nvp.sourceforge.net|PayPal NVP library]] + Note: This examples assumes you can read symbols from properties files (see Tapestry5HowToReadSymbolsFromPropertiesFile). Also, it uses the [[http://paypal-nvp.sourceforge.net|PayPal NVP library]]. {{{ public class AppModule { + // make configuration from 'paypal.properties' on the classpath available as symbols - public PropertiesFileSymbolProvider buildClasspathPropertiesFileSymbolProvider(Logger logger) { + public PropertiesFileSymbolProvider buildPayPalPropertiesFileSymbolProvider(Logger logger) { return new PropertiesFileSymbolProvider(logger, "paypal.properties", true); + } + public static void contributeSymbolSource(OrderedConfiguration<SymbolProvider> configuration, + @InjectService("PayPalPropertiesFileSymbolProvider") SymbolProvider payPalPropertiesFileSymbolProvider) { + configuration.add("ClasspathPropertiesFile", payPalPropertiesFileSymbolProvider, "after:SystemProperties", "before:ApplicationDefaults"); } } }}} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
