Glassfish 2.1.1 缓存我的应用程序 web.xml 文件
我使用 web.xml 部署描述符在 Glassfish 2.1.1 服务器上部署了一个 Struts2 Web 应用程序。
在那里,我传递了一些应用程序参数,例如:
<context-param>
<param-name>uploadDirectory</param-name>
<param-value>/media/data/</param-value>
</context-param>
当我在 Glassfish 上部署应用程序后更改此参数时,即使在整个 Glassfish 域重新启动后也没有任何反应。
我观察到,域下的“生成”文件夹下有 web.xml 文件和其他文件(如 Hibernate 映射)的副本,但找不到影响参数值的方法,即使我删除这些文件文件。
有没有办法清除此缓存/强制重新生成/使 Glassfish 再次读取我更改的 web.xml 文件的内容,而无需重新部署应用程序?
谢谢
I have a Struts2 web app deployed on a Glassfish 2.1.1 server, using a web.xml deployment descriptor.
In there, I pass some application params like for example:
<context-param>
<param-name>uploadDirectory</param-name>
<param-value>/media/data/</param-value>
</context-param>
When I change this param after I have deployed the application on Glassfish, nothing happens, even after a reboot of the whole Glassfish domain.
I have observed that there is a copy of the web.xml file and other files like Hibernate mappings under the "generated" folder under the domain, but can't find a way to affect the value of the param, even if I delete those files.
Is there a way to clear this cache / force regeneration / make Glassfish read again the contents of my changed web.xml file without redeploying the App?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
web.xml 文件是部署描述符。当您部署应用程序时会对其进行处理,并将生成的部署配置保存在为域生成的目录中。
如果您更改“源”web.xml 中的值,则在您重新部署应用程序之前,这些更改不会传播到实际使用中。
如果您想避免创建存档和分解存档等步骤,我建议使用 目录部署...
如果您编辑生成的目录中的文件并重新启动服务器,您也许可以避免重新部署,但这似乎需要更多时间时间比目录部署。您还应该注意,这对于用于在部署时生成代码的描述符元素不起作用......
The web.xml file is a deployment descriptor. It is processed when you deploy your app and the resulting deployment configuration is saved in the generated directory for the domain.
If you change the values in the 'source' web.xml, those changes will not propagate into active use until you redeploy your app.
If you want to avoid steps like creating an archive and exploding the archive, I would recommend using directory deployment...
You may be able to avoid doing a redeploy if you edit the file in the generated directory and restart the server, but that seems like it will take more time than a directory deployment. You should also note that this will not work for descriptor elements that are used to generate code at deployment time...