Is it possible to apply changes to JSF files without republishing?

放肆的年华 提交于 2019-12-02 12:11:38

问题


I'm using IBM RAD version 8.0 and deploying the EAR applications to IBM WebSphere 7.0. Each time I change a JSF file, I need to republish the application, otherwise the changes are not visible.

Publishing takes some time, so usually it takes minimum a minute before I'm able to see the efects of even the most minor change. In 'normal' application development it's about a few seconds, and it's crucial for someone who is no JSF coryphee and still learns and needs to experiment...

Is it possible to use the JSF ability to re-load the JSF page definition without application restarting, when working with IBM RAD and WebSphere? Or I'll be forced to create second environment with Eclipse & Tomcat, for JSF experiments only?


回答1:


This is normally to be configured in server configuration. Doubleclick the desired server in Eclipse's Servers view and head to Publishing section.


Note that you should take Facelet cache into account as well, particularly when using MyFaces which caches relatively agressively. If you make sure that javax.faces.PROJECT_STAGE context parameter is set to Development, then both MyFaces and Mojarra will relax the Facelet caching strategy, causing it to recompile the Facelet file almost instantly instead of using the cached version for a rather long time.

An alternative to Publishing setting is to use JRebel. It is able to publish changes in Java classes such as managed beans and EJBs as well, saving a lot of hotdeployment time. It has an Eclipse plugin as well.




回答2:


This thread is old, but I still had the same problem, using eclipse and WebSphere.

One place to check is this. If you use JSF files with the .xhtml ending, you have to make sure that changes in these do not trigger automatic republishing.

  1. In the tab "Servers" double-click on your server.
  2. Open the "Publishing settings for WebSphere Application Server"
  3. Click on "Set Advanced Publishing Settings...".
  4. In the "List of file extensions that do not trigger the server to publish ..." insert or append ", *.xhtml".
  5. Close these settings and restart the server.

In web.xml I have also added a parameter with the name javax.faces.PROJECT_STAGE and the value Development , which may have an influence on the offending behavior.



来源:https://stackoverflow.com/questions/14280675/is-it-possible-to-apply-changes-to-jsf-files-without-republishing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!