1

I have 2 maven projects (war and jar).
I would like to put jsf pages into the jar project that will be used in my webapp page.

This is the structure of my jar

JarProject
|-- META-INF
| |-- resources
| | | -- myPages
| | | | `-- pages.xhtml
| |-- faces-config.xml
| com
| |....

In my web project, I put my jar in

WEB-INF\lib

and I included my page like this

<ui:include src="/myPages/pages.xhtml" />

I tried this solution, but it didn't work, can you tel me what I've missed

Sarroura
  • 553
  • 1
  • 6
  • 15
  • Please see http://stackoverflow.com/questions/6104498/jee6-packaging-jsf-facelets-xhtml-and-managedbeans-as-jar and http://stackoverflow.com/questions/3531432/jsf2-pages-into-a-jar – Charlee Chitsuk Mar 22 '13 at 10:04
  • Thxs for your reply, I've tried this, but it didn't works – Sarroura Mar 22 '13 at 10:05
  • 2
    @Sarroura show us your `faces-config.xml` file – partlov Mar 22 '13 at 10:06
  • 1
    Which application server do you use? Is it JavaEE 5 or 6? – Charlee Chitsuk Mar 22 '13 at 10:07
  • @partlov I put an empty Faces-config.xml – Sarroura Mar 22 '13 at 10:11
  • @Charlee Chitsuk I'm using Tomcat – Sarroura Mar 22 '13 at 10:11
  • @Sarroura see `faces-config.xml` file from [this link](http://stackoverflow.com/a/6105009/759126). It should not be completely empty. – partlov Mar 22 '13 at 10:12
  • AFAIK, you may need to use the `FaceletsResourceResolver` as mentioning at http://stackoverflow.com/questions/5587808/how-to-use-facelets-composition-with-files-from-another-context – Charlee Chitsuk Mar 22 '13 at 10:13
  • @partlov, I used the same faces-config – Sarroura Mar 22 '13 at 10:13
  • Tomcat does not support this feature. Only JavaEE6 application server does. – Charlee Chitsuk Mar 22 '13 at 10:17
  • OP is using Maven. This requires understanding how Maven structures the projects differently from the standard and how Maven needs to be configured to build the proper JAR. The answers which are linked in the previous comments do not assume Maven, they just assume standard Servlet spec. Important fact is that `/META-INF/resources` is supposed to end up in **classpath**, not in **webcontent**. – BalusC Mar 22 '13 at 13:16
  • There is no differnce by using maven, but @CharleeChitsuk said that Tomcat does not support this – Sarroura Mar 22 '13 at 13:48

0 Answers0