2

In my web-app (maven, spring) I have the following project structure:

MyWebApp
--src
  --main
    --java
      ...
    --resources
      --spring
        spring_stuff.xml
        ...
      mywebapp.properties
      mylogs.xml
    --webapp
      --spring
        --appServlet
          servlet-context.xml
      ...
pom.xml

One I deploy the WAR file to a Tomcat server using the Manager App, the war gets unpacked and the files above are available in the webapp folder. However, if I am not allowed to modify the files since they are 'in-use' by the web server. What can I do differently to be able to modify the property files while Tomcat is running and without having to restart it?

Is there a way (maybe in maven/spring) to set up a project so that different properties are enabled/disabled depending on where the WAR gets deployed?

Marsellus Wallace
  • 17,991
  • 25
  • 90
  • 154

2 Answers2

1

I use a program called Jrebel

It checks for code changes, and on compiles deploys war automatically without having to restart tomcat.

Dan Ciborowski - MSFT
  • 6,807
  • 10
  • 53
  • 88
  • Thanks but let's suppose that I just have to change the db ip because we are moving it elsewhere or I just have to start saving logs elsewhere, why should I change my code for that? I'm looking for a way to be able to modify my xml/property (that's why I have these files in the first place) files without having to touch my code at all! – Marsellus Wallace Nov 30 '12 at 22:13
0

Looks like an old question but the problem statement in this question is perfect case of the usage of JMX which is a web based console to update message beans without restarting the server. There is JConsole as well but that is not web based.

Ashish
  • 3,572
  • 3
  • 18
  • 25