Dear Wiki user, You have subscribed to a wiki page or wiki category on "Jakarta-tapestry Wiki" for change notification.
The following page has been changed by SvenHomburg: http://wiki.apache.org/jakarta-tapestry/UsingCustomResourceSourceForLibs New page: overwrite tapestry's ComponentMessagesSourceImpl like this ... == the new ComponentMessagesSource implementation == {{{ public class Core4ComponentMessagesSourceImpl extends ComponentMessagesSourceImpl { /** * Returns an instance of [EMAIL PROTECTED] java.util.Properties}containing the properly localized messages for the * component, in the [EMAIL PROTECTED] java.util.Locale}identified by the component's containing page. */ protected synchronized Properties getLocalizedProperties(IComponent component) { Properties tapestryProperties = super.getLocalizedProperties(component); INamespace iNamespace = component.getNamespace(); while (iNamespace != null && !iNamespace.isApplicationNamespace()) iNamespace = iNamespace.getParentNamespace(); if (iNamespace != null) { iNamespace.getSpecificationLocation().getPath(); String globalMessagefile = iNamespace.getSpecification().getProperty("global.message.file"); if (globalMessagefile == null) throw new ApplicationRuntimeException("application property 'global.message.file' not set!"); globalMessagefile = component.getPage().getRequestCycle().getInfrastructure().getContextRoot().getRelativeResource(globalMessagefile). getResourceURL().getFile(); try { tapestryProperties.load(new FileInputStream(globalMessagefile)); } catch (IOException e) { throw new ApplicationRuntimeException(e); } } return tapestryProperties; } } }}} == your application hivemind.xml == {{{ <implementation service-id="tapestry.ComponentMessagesSource"> <invoke-factory> <construct class="de.hsofttec.core4.service.impl.Core4ComponentMessagesSourceImpl"> <event-listener service-id="tapestry.ResetEventHub"/> <set-object property="componentPropertySource" value="infrastructure:componentPropertySource"/> </construct> </invoke-factory> </implementation> }}} == put this in your application properties == {{{ <meta key="global.message.file" value="WEB-INF/conf/global.messages.properties"/> }}} --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
