How to reference CSS / JS / image resource in Facelets template?

前端 未结 4 2152
刺人心
刺人心 2020-11-21 05:00

I\'ve done tutorial about Facelets templating.

Now I\'ve tried to create a page that isn\'t in same directory as the template. I\'ve got problems with page style, b

4条回答
  •  借酒劲吻你
    2020-11-21 05:31

    The resourcehandlers.UnmappedResourceHandler helps to map JSF resources on an URL pattern of /javax.faces.resource/*.

    For me these 2 xml configs in faces-config.xml: org.omnifaces.resourcehandler.UnmappedResourceHandler

    and in web.xml:

    
    facesServlet
    /javax.faces.resource/*
    *.xhtml
    
    

    helped with css and images.

提交回复
热议问题