把 java web application deploy 到 root

http://stackoverflow.com/questions/5328518/deploying-my-application-at-the-root-in-tomcat

You have a couple of options:

  1. Remove the out-of-the-box ROOT/ directory from tomcat and rename your war file to ROOT.war before deploying it.

  2. Deploy your war as (from your example) war_name.war and configure the context root in conf/server.xml to use your war file :

    <Context path="" docBase="war_name" debug="0" reloadable="true"></Context>

The first one is easier, but a little more kludgy. The second one is probably the more elegant way to do it.

posted @ 2016-07-25 19:03  johnsonshu  阅读(217)  评论(0编辑  收藏  举报