Hi Nille, Thanks for your reply!
> I presume that the error occurs, because in development environment the file > is accessible as file whilst in production it is packed into a jar. kind of, its packaged as a war, and then deployed... so the file's destination is: "/AppName/WEB-INF/context.properties" but in development this is: "src/main/webapp/WEB-INF/context.properties", the key is to be able to reference /WEB-INF/ regardless of where it's deployed. > Maybe the ClasspathResourceSymbolProvider suits your needs. I am also using it and it is works well: public static void contributeSymbolSource( OrderedConfiguration<SymbolProvider> configuration, @InjectService("ClasspathPropertiesSymbolProvider") SymbolProvider classpathResourceSymbolProvider) { configuration.add("ClasspathResource", classpathResourceSymbolProvider, "after:SystemProperties", "before:ApplicationDefaults"); } and: public ClasspathResourceSymbolProvider buildClasspathPropertiesSymbolProvider() { return new ClasspathResourceSymbolProvider("classpath.properties"); } But what I really want is a ContextSymbolProvider to work in the same way, except I have this packaging issue to resolve. cheers, Peter ----- Original Message ----- From: "nille hammer" <tapestry.nilleham...@winfonet.eu> To: "Tapestry users" <users@tapestry.apache.org> Sent: Monday, 6 July, 2009 14:39:05 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: Referencing the context path in AppModule Hi Peter, I presume that the error occurs, because in developent environment the file is accessible as file whilst in production it is packed into a jar. There are some other implementations for interface SymbolProvider, look here: http://tapestry.apache.org/tapestry5.1/apidocs/org/apache/tapestry5/ioc/services/SymbolProvider.html Maybe the ClasspathResourceSymbolProvider suits your needs. Of course the implementations are internal. I have browsed the api-docs a bit, but could not find a solution for not using the internal class (instead of coding everything yourself). Regards, nillehammer == http://www.winfonet.eu ----- original Nachricht -------- Betreff: Referencing the context path in AppModule Gesendet: Mo, 06. Jul 2009 Von: Peter Stavrinides<p.stavrini...@albourne.com> > Hi all, > > I am trying to referencing a properties file in my AppModule... currently I > am doing this based on the wiki example: > > public ContextSymbolProvider buildFileSystemPropertiesSymbolProvider() { > return new ContextSymbolProvider( > "src/main/webapp/WEB-INF/context.properties", false); > } > > Which works in development (maven and jetty), but when I deploy, its to > tomcat, and tomcat can't find that path. I am wandering if someone could > suggest a better way to reference my properties file in a portable way. > > Thanks, > Peter > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > --- original Nachricht Ende ---- --------------------------------------------------------------------- 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