Note that there are some explanatory texts on larger screens.

plurals
  1. POFacelets custom tag not rendering
    text
    copied!<p>I am trying to create a custom tag with Facelets but it isn't rendering (i.e. the tag appears unreplaced in the response).</p> <p>The tag (/WEB-INF/facelets/tags/inputThumbnailSelector.xhtml): </p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:t="http://myfaces.apache.org/tomahawk"&gt; &lt;ui:composition&gt; &lt;div style="position: relative;"&gt; &lt;img style="position: absolute; left: 0; top: 0;" src="#{image}"/&gt; &lt;div class="thumbnail-selector" style="position: absolute; left: #{backingBean.thumbnailLeft}; top: #{backingBean.thumbnailTop};"/&gt; &lt;/div&gt; &lt;/ui:composition&gt; &lt;/html&gt; </code></pre> <p>/WEB-INF/facelets/tags/panayk.taglib.xml: </p> <pre><code>&lt;!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "http://java.sun.com/dtd/facelet-taglib_1_0.dtd"&gt; &lt;facelet-taglib&gt; &lt;namespace&gt;http://panayk.endofinternet.org/jsf&lt;/namespace&gt; &lt;tag&gt; &lt;tag-name&gt;inputThumbnailSelector&lt;/tag-name&gt; &lt;source&gt;inputThumbnailSelector.xhtml&lt;/source&gt; &lt;/tag&gt; &lt;/facelet-taglib&gt; </code></pre> <p>My web.xml contains:</p> <pre><code>&lt;context-param&gt; &lt;param-name&gt;javax.faces.FACELETS_LIBRARIES&lt;/param-name&gt; &lt;param-value&gt;/WEB-INF/facelets/tags/panayk.taglib.xml&lt;/param-value&gt; &lt;/context-param&gt; </code></pre> <p>This is how the tag is called:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:t="http://myfaces.apache.org/tomahawk" xmlns:my="http://panayk.endofinternet.org/jsf"&gt; &lt;ui:composition template="/layout/layout.xhtml"&gt; ... &lt;my:inputThumbnailSelector image="${facesContext.externalContext.requestContextPath}/image/get.servlet?id=1" backingBean="#{entryHandler}"/&gt; ... &lt;/ui:composition&gt; &lt;/html&gt; </code></pre> <p>Many thanks in advance!</p>
 

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