JRebel 处理 /WebContent 文件夹更改。
问题是Facelets执行缓存并且不重新读取更改的文件。要强制重读,请在 中指定以下参数。web.xml
JSF 2 (Facelets 2.x):
<!-- Time in seconds that facelets should be checked for changes since last request. A value of -1 disables refresh checking. -->
<context-param>
<param-name>javax.faces.FACELETS_REFRESH_PERIOD</param-name>
<param-value>0</param-value>
</context-param>
<!-- Set the project stage to "Development", "UnitTest", "SystemTest", or "Production". -->
<!-- An optional parameter that makes troubleshooting errors much easier. -->
<!-- You should remove this context parameter before deploying to production! -->
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
对于 JSF 1.2(Facelets 1.x),参数为:
<context-param>
<param-name>facelets.REFRESH_PERIOD</param-name>
<param-value>0</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
有关 JSF 上下文参数的更多信息:http://docs.jboss.org/jbossas/6/JSF_Guide/en-US/html/jsf.reference.html#standard.config.params
对于您的情况,不需要该自定义资源解析程序。该资源解析器只是从自定义文件系统文件夹中获取xhtml文件的一种棘手方法。在你的情况下,JRebel就是这样做的(甚至更多)。