如何以编程方式热重载Wildfly服务器中的xhtml之类的静态资源,以解决爆炸战争中出现的lib [英] How to programmatically hot reload static resources like xhtml in wildfly server for libs present in exploded war

查看:105
本文介绍了如何以编程方式热重载Wildfly服务器中的xhtml之类的静态资源,以解决爆炸战争中出现的lib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在wildfly 10中爆炸了基于JSF的war文件.我有多个带有XHTML和CDI bean的jar文件,它们存在于爆炸war的lib中. 如果我更改了XHTML文件中与lib表示的jar相关的源中的内容,则需要重新加载内容,而无需更新lib文件夹中的jar文件并重新部署war文件.

I have exploded war file based on JSF in wildfly 10. I have multiple jar files with XHTML and CDI beans which are present inside the lib of exploded war. If I change the content in XHTML file present in source related to the jar present in lib means, the content needs to be reloaded without updating the jar file in lib folder and redeploying the war file.

如何实现此功能?在netbeans/eclipse IDE中,此功能已作为复制静态资源"提供.但这对罐子不起作用.

How to achieve this functionality? This is already available in netbeans / eclipse IDE as "Copy static resources". But this is not working for the jar.

环境: 服务器:Wildfly 10 项目类型:JSF maven

Environment: Server : Wildfly 10 project type: JSF maven

推荐答案

我认为问题在于,您更新的资源包装在爆炸战争WEB-INF/lib中的一个jar中,因此需要将整个jar放在替换为WEB-INF/lib,wildfly需要重新加载此jar.

I think the problem is that the resource you update is packaged in a jar located in the exploded wars WEB-INF/lib, whereby the whole jar needs to be replaced in WEB-INF/lib and wildfly needs to reload this jar.

只有爆炸战争中的资源可以更新,这意味着用修改后的资源替换旧资源.这是很多人面临的网络碎片的老问题.我们通过打包战争实现Web片段并在主战中使用叠加来解决此问题,该任务将所有Web片段内容复制到主战项目中,并由唯一的命名空间分隔.

Only resources in the exploded war can be updated, which means to replace the old resource with the modified one. This is an old issue with web-fragments lots of people have faced. We have solved it by implementing the web fragments with packaging war and using overlay in the main war, which copies all web-fragments content to that main war project, which are separated by unique namespaces.

我不知道是否可以将wildfly配置为重新加载库jar,如果您实现了在爆炸战争的WEB-INF/lib中重新部署jar的话.

I don't know if wildfly can be configured to reload library jars, if you achieve to redeploy a jar in WEB-INF/lib of the exploded war.

请参阅以下讨论,也许您会找到更多帮助:

See the following discussions maybe you find more help:

在IntelliJ中的Web片段项目中热重新部署文件

https://developer.jboss.org/thread/252106

如何强制jboss从webapp的lib中的jar加载类

https://www.protechtraining.com/bookshelf/jboss_admin_tutorial/class_loading ?ncr = 1

https://access.redhat.com/solutions/334963

这篇关于如何以编程方式热重载Wildfly服务器中的xhtml之类的静态资源,以解决爆炸战争中出现的lib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆