JSF and automatic reload of xhtml files

前端 未结 2 1802
半阙折子戏
半阙折子戏 2020-12-01 10:43

I had some problems with hot-reloading XHTML files using JRebel, Spring, JSF Mojarra 2.0.3 and WebLogic 10.3.

JRebel reloads regular Java classes and js/css files un

2条回答
  •  暖寄归人
    2020-12-01 11:32

    JRebel handles /WebContent folder changes.

    The problem is that Facelets do caching and do not reread changed files. To force reread specify the following parameters in web.xml.

    JSF 2 (Facelets 2.x):

    
    
        javax.faces.FACELETS_REFRESH_PERIOD
        0
    
    
    
    
    
    
        javax.faces.PROJECT_STAGE
        Development
    
    

    For JSF 1.2 (Facelets 1.x) parameters are:

    
        facelets.REFRESH_PERIOD
        0
    
    
        facelets.DEVELOPMENT
        true
    
    

    More on JSF context params: http://docs.jboss.org/jbossas/6/JSF_Guide/en-US/html/jsf.reference.html#standard.config.params

    That custom resource resolver is not needed in your case. That resource resolver is just a tricky way to get xhtml files from custom file system folder. In your case JRebel does that (and even more).

提交回复
热议问题