• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Web applications with various configurations files

 
Alex Florentino
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have an site that will respond for various domains.

sample:

<Host name="site1.site.com" debug="1" appBase="c:\foldersrc" unpackWARs="true" autoDeploy="true">
<Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="site1." suffix=".txt" timestamp="true"/>
<Context path="" docBase="." debug="0" reloadable="true" crossContext="true"></Context>
</Host>

<Host name="site2.site.com" debug="1" appBase="c:\foldersrc" unpackWARs="true" autoDeploy="true">
<Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="site2." suffix=".txt" timestamp="true"/>
<Context path="" docBase="." debug="0" reloadable="true" crossContext="true"></Context>
</Host>

then the folder of source of my web application will be same for all domains.

but I need that a each domain has your own configuration file(properties file).

someone have some good idea how I can make it ?

thanks.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can place context init param entries in the <Context ../> tag for each instance. This would allow you to set a different path for each app's config files.
 
Alex Florentino
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok,
but I still need load this file, where I could load this file ? when the context is started ? it is good a idea ?

I create the Context Listener:

are in WEB-INF/classes/


and my server.xml in context element I put this entry:



but when I start tomcat I get this error:



whats I made wrong ? any suggestion ?

thanks.

[ October 05, 2007: Message edited by: Alex Florentino ]
[ October 05, 2007: Message edited by: Alex Florentino ]
 
Alex Florentino
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed instead of create context listener I create a servlet and put it:



in my source code.

and init method I load application configuration.
[ October 05, 2007: Message edited by: Alex Florentino ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic