• Post Reply Bookmark Topic Watch Topic
  • New Topic

setting message resources outside war  RSS feed

 
Krishna Nair
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working in a maintenance project. The requirement says that I have to set the properties files which is now existing inside classes folder ( actually this is inside source folder and will be copied to classes during build ) to a path which is existing outside the war. When I did googling and read the archive mails I found that keeping the file in a folder say c:\bea\messages and setting the class path variable to this folder will solve the issue. But I feel that the folder where we keep the properties file can't be changed if I ship the product to client.Also I read that we can setup environment variable to do the task. Is it possible to do the setting in some server configuration file? Please give me a specific answer. My development environment uses JBoss and production environment can be weblogic or websphere.

Thanks

krishna
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use a context init parameter to store the location of your config file. Tomcat's context entries (either in server.xml or in the newer context fragment files) reside outside the web application and can be used to set the values for context-init-params.
JBoss uses Tomcat internally as its servlet container.

You could also look into setting up a JNDI environment variable to hold the path information.
http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html

You may need to read the JBoss documentation to see exactly how things are done with that container.
 
Krishna Nair
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ben,

Thanks for the reply.

The messages were already defined inside the JSP and all and it was not practical for changing the same. As directed by you, I went through the doc files of weblogic( that was the server used by my client) and found that if we set the classpath only in setDomainEnv.cmd it will take the messages.properties from that path. Earlier I was hesitant to set the classpth of the entire system and that is not required in this case.

Your suggestions were extremely helpful and because of that only I went through server docs

thanks

krishna
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!