0

I trie to get working the EL tag that i can show an image from my resources folder but it dosen't seem to work. The following example:

my xhtml

 <p:dock position="bottom">
    <p:menuitem value="Home" icon="#{resource['icon:img/exit.png']}" url="#" />
 </p:dock>

And also i tried:

<p:menuitem value="Home" icon="#{resource['img/exit.png']}" url="#" />  

<p:menuitem value="Home" icon="#{resources['img/exit.png']}" url="#" />

<p:menuitem value="Home" icon="#{resource['default:img/exit.png']}" url="#" /> 

<p:menuitem value="Home" icon="#{resources['img:exit.png']}" url="#" />

All of the above didn't work. Whats wrong? I have set the web.inf tag as follow:

  <context-param>
   <param-name>javax.faces.WEBAPP_RESOURCES_DIRECTORY</param-name>
   <param-value>/WEB-INF/resources</param-value>
  </context-param>

EDIT

Have solved my own problem. I have add the folder in the META-INF and i worked. Very strange

Captai-N
  • 1,124
  • 3
  • 15
  • 26
  • I use like that `#{request.contextPath}/resources/img/exit.png` – Zaw Than oo May 09 '17 at 09:22
  • I assume you have debugged, increased server side logging and more and found some relevant information in there – Kukeltje May 09 '17 at 12:33
  • You have to register resource libraries first to access its items. You can find some information here : http://stackoverflow.com/questions/11988415/what-is-the-jsf-resource-library-for-and-how-should-it-be-used – The Bitman May 09 '17 at 17:04

0 Answers0