Announcement Announcement Module
No announcement yet.
Changing Tomcat Context in example app Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Changing Tomcat Context in example app

    Hey, everyone! Just getting started here with roo and am really excited about this project.. Such an easy way to get things started! Thanks to everyone involved.

    This might be more of a spring question (to which I am also new), but I've successfully created a simple 'myproject' app and deployed it with mvn tomcat:run and everything works great. However, I'd like to change the context from myproject/ to ROOT/ (ie - http://localhost:8080 instead of http://localhost:8080/myproject). I can't seem to figure out how to do that.

    I've seen some posts about changing the Web-ContextPath in the MANIFEST.MF file. I've tried that by adding it to the pom.xml, but tomcat doesn't seem to be picking that up. Any suggestions?


  • #2
    Hi John,

    there are several ways to approach this. The easiest is to create a war file ('perform package'), and then rename your war file to ROOT.war. Then drop it into the tomcat webapps folder and you should be able to access the app from the root URL http://localhost:8080

    Note, this would overwrite the default Tomcat manager app which usually lives there.

    You can also configure it via the a Tomcat specific context.xml file which is explained here:



    • #3
      Hey Stefan,

      Thanks for your quick reply.. I really appreciate it. I'll try out the context.xml in the tomcat conf/ directory! I'll let you know how it works out.