質問

I'm doing a project with JSF. I have created a page that displays information about some movies. Everything works so far. Now I want to implement the possibilty to display information about tv series as well. For this I'd like to bin everything that has do with displaying movies into a subproject that will produce a .jar-file which I then will include in my main project. For the tv series I'll make the same thing.

At the moment I have just this one project and it's structered like this (I show only the relevant parts):

wgmdb.war
 \_ src
     \_ main
         \_ webapp
             \_ view
                 \_ overview.xhtml
                 \_ movies
                     \_ details.xhtml

In my overview.xhtml I include details.xhtml like this:

My goal is something achieve now something like the following, where wgmdb-movies.jar is a library included by the main project:

wgmdb.war
 \_ src
     \_ main
         \_ webapp
             \_ view
                 \_ overview.xhtml

wgmdb-movies.jar
 \_ src
     \_ main
         \_ resources
             \_ details.xhtml

The problem is now, that I have now idea how to include details.xhtml from the library into the overview.xhtml of the main project. What src path must I use that details.xhtml will be found?

Best regards,

metalhamster

役に立ちましたか?

解決

The details.xhtml has to end up like /META-INF/resources/details.xhtml in the JAR. This way you'll be able to just use <ui:include src="details.xhtml">.

In Maven perspective, that would be /src/main/resources/META-INF/resources/details.xhtml.

See also:

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top