Can I use EL for external CSS files with JSF?

前端 未结 6 1093
情歌与酒
情歌与酒 2020-12-19 07:46

In external style sheets of my current JSF project, there are hard-coded links to external resources like

.someId { background-image:url(/context/resources/i         


        
6条回答
  •  自闭症患者
    2020-12-19 08:34

    No, you can't. You have several options:

    • hard-code absolute paths (domain relative, of course) - not that bad
    • use relative paths - can be a problem when you have nested urls like /view/external/foo/bar.jsf
    • preprocess them during build to set the proper paths
    • use a Filter (and both client and server-side caching) to set the proper paths.

    (I feel I'm missing something)

提交回复
热议问题