Myfaces / Omnifaces资源处理程序奇怪的行为

时间:2015-09-24 09:50:36

标签: jsf-2.2 myfaces omnifaces

我们正在使用omnifaces(最新快照)资源处理程序来组合和取消映射资源处理程序

    <resource-handler>org.omnifaces.resourcehandler.CombinedResourceHandler</resource-handler>
    <resource-handler>org.omnifaces.resourcehandler.CDNResourceHandler</resource-handler>                
    <resource-handler>org.omnifaces.resourcehandler.UnmappedResourceHandler</resource-handler>    

(也使用Unmapped但不适用于此页面)

有时,当projectStage正在生产时,我们已经破坏了css包含。

这是正常的制作html(格式化和缩进):

<link rel="stylesheet" type="text/css" href="/javax.faces.resource/eNptjMEKgzAQRL8ou63Si3-TriMKiQm724PgxxcKGtDehnnzpuqSMUWBhXcpbq6xDj4jg8RsryceWryQJnITJZXPOKWoCDKunLFBg8Lg3NGDf4nysv4bn3_BkCDOT-rpdasP_QtAUUrT.css?ln=omnifaces.combined&amp;v=1431853580000" />
<script type="text/javascript" src="/javax.faces.resource/eNp9UMsSwiAM_KKS8XXx6kd4Rpq2VCDIQ6czfrzQaunU0VM2u5uwxDqpseEC_bG_RXQDTIX1_ml_aJVVsZXGrzwFZoG0kRM_o0z3HgRpTSY3F6Lgg-MWdmzH9pDEmWJajh6hKNaN4g4rUZuiVx4VigCbNHn4oj_TJRPIWmF6VwZyS5xdXdBqK7i5cw8LPEZs_UMG0aGDAlcf_7N54eooXHGAqbxPceYynLijmFIn6gXsJJuf.js?ln=omnifaces.combined&amp;v=1443076786000"></script>
<link rel="stylesheet" type="text/css" href="/javax.faces.resource/font-awesome/4.3.0/css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="/javax.faces.resource/bootstrap/3.3.4/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="/javax.faces.resource/css/estilos.css?version=1443076733865" />
<link rel="stylesheet" type="text/css" href="/javax.faces.resource/css/styles.css?version=1443076733865" />
<link rel="stylesheet" type="text/css" href="/javax.faces.resource/css/icons/icons.css" />

这是破碎的代码:

<link rel="stylesheet" type="text/css" href="/javax.faces.resource/eNptjMEKgzAQRL8ou63Si3-TriMKiQm724PgxxcKGtDehnnzpuqSMUWBhXcpbq6xDj4jg8RsryceWryQJnITJZXPOKWoCDKunLFBg8Lg3NGDf4nysv4bn3_BkCDOT-rpdasP_QtAUUrT.css?ln=omnifaces.combined&amp;v=1431700834000" />
<script type="text/javascript" src="/javax.faces.resource/eNp9j9EOwiAMRb8IGp2--DcInWMCRQomS_x4mYuOzOhTb--5bdOYrMdeaeTTeCuYJliKHPkRfzARXbnYwJvMKmcwMmjynsLcnIky56QidLKTB6jwY0lvXxntqJjeqYRCm7BywehQZ9jVyeOX_Z5ej4M1Dutdmym1ek4N2bu9VuGuGBq9eeTPgiY1UL7iBEup7AlS-4D0.js?ln=omnifaces.combined&amp;v=1442328192000"></script>
<link rel="stylesheet" type="text/css" href="/javax.faces.resource/font-awesome/4.3.0/css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="/javax.faces.resource/javax.faces.resource/bootstrap/3.3.4/css/bootstrap.m" />
<link rel="stylesheet" type="text/css" href="/javax.faces.resource/css/estilos.css?version=1443087413884" />
<link rel="stylesheet" type="text/css" href="/javax.faces.resource/css/styles.css?version=1443087413884" />
<link rel="stylesheet" type="text/css" href="/javax.faces.resource/css/icons/icons.css" />

请注意,boostrap css已损坏,javax.faces.resource为2次且文件名不完整。

我们不知道这是myfaces(2.2.8)还是omnifaces(最新快照)。它不会在开发模式下发生,它只会在生产中不时发生(可能是2%)。它必须与日期有关,但我们不知道。

这是web.xml的相关信息

<context-param>
    <param-name>org.omnifaces.CDN_RESOURCE_HANDLER_URLS</param-name>
    <param-value>
        cloudflare-cdn:bootstrap-select/1.3.5/bootstrap-select.min.css=https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.3.5/bootstrap-select.min.css,
        cloudflare-cdn:bootstrap-select/1.3.5/bootstrap-select.min.js=https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.3.5/bootstrap-select.min.js,
    </param-value>
</context-param>
<context-param>
    <param-name>org.omnifaces.CDN_RESOURCE_HANDLER_DISABLED</param-name>
    <param-value>#{facesContext.application.projectStage == 'Development'}</param-value>
</context-param>

<context-param>
    <param-name>org.omnifaces.COMBINED_RESOURCE_HANDLER_DISABLED</param-name>
    <param-value>#{facesContext.application.projectStage == 'Development'}</param-value>
</context-param>

<context-param>
    <param-name>org.omnifaces.COMBINED_RESOURCE_HANDLER_EXCLUDED_RESOURCES</param-name>
    <param-value>
        bootstrap/3.3.4/css/bootstrap.min.css,
        dashboard/dashboard.css,
        css/estilos.css,css/styles.css,
        font-awesome/4.3.0/css/font-awesome.min.css,
        css/icons/icons.css,fancybox/3b1/jquery.fancybox.js,fancybox/3b1/jquery.fancybox-thumbs.js
    </param-value>
</context-param>
<context-param>
    <param-name>org.omnifaces.COMBINED_RESOURCE_HANDLER_CACHE_TTL</param-name>
    <param-value>3600000</param-value>
</context-param>    

0 个答案:

没有答案