共计 337 个字符,预计需要花费 1 分钟才能阅读完成。
Web 应用部署在 tomcat 中,默认是带了 web 应用名称的。
例如:web 应用项目名称为:testweb,则部署到 tomcat 后,是部署在 tomcat/webapps/testweb 中,网址为:http://localhost:8080/testweb。
一般我们实际使用是不带 testweb 的,发现了一个小方法。
修改 Web Context-root 的值为“/”,就可以将 testweb 去掉,看 webapps,testweb 是部署到了 webapps/ROOT 中的,实际的应用部署也需要部署在 ROOT 中。
原理不解释,看下 tomcat 文档就能明白,不看也行,知道怎么用也就够了!
注意:建议使用 tomcat7,tomcat6 没测试。
另外:如果想更简单的开发使用,推荐使用内嵌 jetty。
正文完