Background url path in a jsf template

后端 未结 2 1715
北恋
北恋 2021-01-06 15:41

i\'m in trouble here. I have a JSF application that has a template file called baseTemplate.xhtml. This file is located in /resources/template folder. Follo

2条回答
  •  时光说笑
    2021-01-06 16:17

    Your case is simple. I copy it :

    /
     pages/
         home.xhtml (using the template)
     resources/
         css/
             cssLayout.css
             imgSite/
                 sisLogo.png
         templates/
             baseTemplate.xhtml
    

    Small pertinent advice : when you do not know how to use relative path or when you have problem to implement it, simply use absolute path. Absolute paths have the powerful advantage in some cases to be mesured from the root. So they are more simple.

    In your case, regardless of the structure, you can do this :

    /Name of your project/PathToTheImage

    Exemple :(Let's suppose your project is called "NewYork". It's just a name! You should do)

    /NewYord/resources/css/imgSite/sisLogo.png

    I suppose you know that you have to include the css path in the jsf code.

    Exemple : (in your case, you have to put this in your code xhtml who need this css)

    
    

    hope help.

    Thanks

提交回复
热议问题