Can I use EL for external CSS files with JSF?

前端 未结 6 1105
情歌与酒
情歌与酒 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:36

    @Bozho: JSF allows to define a ResourceHandler to replace the standard one. You could just subclass javax.faces.application.ResourceHandler, handle specific requests and delegate others to the base class.

    For the given example, the custom resource handler should determine the context and replace absolute path definitions. This enables dynamic path resolution on a per-request base.

提交回复
热议问题