Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/333.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java JSF2资源处理程序无法计算资源css中的EL表达式[…]_Java_Css_Jsf_Primefaces - Fatal编程技术网

Java JSF2资源处理程序无法计算资源css中的EL表达式[…]

Java JSF2资源处理程序无法计算资源css中的EL表达式[…],java,css,jsf,primefaces,Java,Css,Jsf,Primefaces,这里使用JSF2.1.1、EL API 2.2和PrimeFaces 3.5。 对于版本资源,我遵循下面给出的答案: 我的getRequestPath()实现与使用文件修改时间作为版本略有不同: @Override public String getRequestPath() { String path = super.getRequestPath(); long time = new File(resource.getURL().getFile()).lastModified

这里使用JSF2.1.1、EL API 2.2和PrimeFaces 3.5。 对于版本资源,我遵循下面给出的答案:

我的getRequestPath()实现与使用文件修改时间作为版本略有不同:

@Override
public String getRequestPath() {
    String path = super.getRequestPath();
    long time = new File(resource.getURL().getFile()).lastModified();

    //  Resource from JARs
    if (time == 0) {
        return path;
    }

    if (path.contains("?")) {
        path += "&";
    } else {
        path += "?";
    }
    path += "t=" + time;
    return path;
}
有了这个,我有两个问题

  • &
    被转义。比如说,

    <script type="text/javascript" src="/myapp/javax.faces.resource/myscript.js.xhtml?ln=js&amp;t=1390492662000">
    
  • 我犯了一个错误

    无法计算资源mytheme.css中的EL表达式资源['mytheme:images/ui-bg_flat_75_F2F1F1_40x100.png']

    请帮忙

    background: url("#{resource['mytheme:images/ui-bg_flat_75_F2F1F1_40x100.png']}");