我有一个 Eclipse Java Web 应用程序,我正在从 Eclipse 3.7 中部署到 Tomcat 7。在我的 Eclipse 服务器配置中 Servers > Tomcatv7-config > server.xml
,我看到在部署我的应用程序时添加了以下行:
<Context docBase="myapp" path="/myapp" reloadable="true" source="org.eclipse.jst.j2ee.server:myapp"/>
我的问题是:有什么方法可以为这个 <Context>
添加参数吗?特定项目的元素?
我需要做的是添加 useHttpOnly=”false”
为了DWR to work properly in Tomcat 7 .我了解这样做的安全风险,所以请不要讲课 :)
最佳答案
您应该能够在您的 WAR/Project 中的/META-INF/中指定一个 context.xml,它将胜过 server.xml 行:
In an individual file at /META-INF/context.xml inside the application files. Optionally (based on the Host's copyXML attribute) this may be copied to $CATALINA_BASE/conf/[enginename]/[hostname]/ and renamed to application's base file name plus a ".xml" extension.
关于eclipse - 从已部署的 Eclipse Web 应用程序设置 Tomcat <Context> 参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7405659/