Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Facelets compositions</strong> (so, just plain <code>*.xhtml</code> pages, templates and include files) are resolved by <a href="http://docs.oracle.com/javaee/6/api/javax/faces/context/ExternalContext.html#getResource%28java.lang.String%29" rel="nofollow noreferrer"><code>ExternalContext#getResource()</code></a> which delegates to <a href="http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContext.html#getResource%28java.lang.String%29" rel="nofollow noreferrer"><code>ServletContext#getResource()</code></a>. This requires a Servlet 3.x compatible container because <code>/WEB-INF/lib/*.jar!/META-INF/resources</code> resolving from is new since Servlet 3.0. If you aren't on Servlet 3.x yet, or want to put those JARs on a different location for some reason, then you'd need to create a custom <a href="http://docs.oracle.com/javaee/6/api/javax/faces/view/facelets/ResourceResolver.html" rel="nofollow noreferrer"><code>ResourceResolver</code></a>. See also <a href="https://stackoverflow.com/questions/6199458/how-to-create-a-modular-jsf-2-0-application/6201044#6201044">How to create a modular JSF 2.0 application?</a></p> <p><strong>Facelets composite components and static resources</strong> (so, <code>&lt;cc:xxx&gt;</code> components and CSS/JS/image resources which are to be loaded by <code>&lt;h:outputStylesheet&gt;</code>, <code>&lt;h:outputScript&gt;</code> and <code>&lt;h:graphicImage&gt;</code>) are resolved from the classpath by <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/ClassLoader.html#getResource%28java.lang.String%29" rel="nofollow noreferrer"><code>ClassLoader#getResource()</code></a>. To include the JAR file in the classpath scan of JSF, you'd need to include a JSF 2.x compatible <code>faces-config.xml</code> file in the <code>/META-INF</code> folder of the JAR file. The same story applies to <code>@ManagedBean</code>, <code>@FacesValidator</code>, <code>@FacesConverter</code>, <code>@FacesComponent</code> and other JSF artifacts.</p> <hr> <p>When developing in Eclipse, you can choose <em>Web > Web Fragment Project</em> to create such a module project. It is not much different from a normal <em>Java project</em>, expect that it will implicitly include JavaScript facet and a targeted runtime, autocreate a <code>/META-INF/web-fragment.xml</code> file and get associated with an existing <em>Dynamic Web Project</em> by adding itself as a deployment assembly to that project.</p> <p>You can also use an existing standard <em>Java project</em> with the right folder structure prepared. The <code>/META-INF</code> folder has to go in Java source folder. The <code>web-fragment.xml</code> file is by the way optional. You just have to manually add the Java project to the <em>Deployment Assembly</em> section of the main web project properties. Do <strong>not</strong> add it as another project in project's <em>Build Path</em> section.</p> <p>When you're (manually) building a JAR file out of it, you need to make sure that the directory entries are added to the JAR, otherwise Facelets compositions can't be resolved. If you're building by build tools like Eclipse/Ant/Maven/etc, this has also to be taken into account. If this is not controllable, a custom <code>ResourceResolver</code> is the most reliable approach.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload