<Context path="/struts2" docBase="D:\strustworkspace\struts2\WebRoot" reloadable="true"/>配置问题

来源:互联网 发布:npm run windows 编辑:程序博客网 时间:2024/05/16 23:05
path是虚拟路径。
1.什么是虚拟路径,在这个上下文里,为什么要设定虚拟路径。不设定不行吗?
2.docBase是实际路径吧?

3.reloadable="true" 这个是什么意思?


1 程序可以放到其他目录下,在这里配置上之后,url中的路径就是path内容,服务器会根据这个配置区相应的docBase去找
2 是的
3 reloadable="true" 看一下tomcat的doc

Set to true if you want Catalina to monitor classes in /WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically reload the web application if a change is detected. This feature is very useful during application development, but it requires significant runtime overhead and is not recommended for use on deployed production applications. That's why the default setting for this attribute is false. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.

翻译过来大概是:如果你想监视/WEB-INF/classes/和/WEB-INF/lib的变动,如果变动则自动重新载入web应用程序(否则tomcat无法检测到你的改动,只有重启tomcat才能使你的改动生效)。在开发阶段这个特征非常有用,但是它需要很大的开销,并且在产品发布后不建议被设置.这就是为什么默认设置是false ......

0 0
原创粉丝点击