This content has been marked as final.
Show 6 replies
-
1. Re: JSF Composition Components with Seam
fernando_jmt May 15, 2007 10:45 AM (in response to nhpvti)Post the page where you are using the composition tag.
-
2. Re: JSF Composition Components with Seam
fernando_jmt May 15, 2007 10:46 AM (in response to nhpvti)And, also tell us where is located your field.xhtml?
webapp/ ?
webapp/WEB-INF?
...etc. -
3. Re: JSF Composition Components with Seam
nhpvti May 16, 2007 4:58 AM (in response to nhpvti)"fernando_jmt" wrote:
And, also tell us where is located your field.xhtml?
webapp/ ?
webapp/WEB-INF?
...etc.
Thank you for the prompt reply.
This is exactly the reason. I've placed taglib file and the component source into /WEB-INF/facelets/tags/my.taglib.xml (as you can see from my web.xml), but Seam deployment script ignores subdirectories in WEB-INF.
I've moved both into WEB-INF and it works :-) !!!!
Composition Components is a very powerfull feature I missed e.g. with Turbine + Velocity, not saying about PHP & Co. Now I can present our decision makers another strong argument for migration to Seam + JSF + Facelets.Post the page where you are using the composition tag.
Before:... <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.ajax4jsf.org/rich" xmlns:my="http://my.com/jsf" template="layout/template.xhtml"> ... <h:outputLabel for="username">Username</h:outputLabel> <h:inputText id="username" value="#{identity.username}"/> <h:outputLabel for="password">Password</h:outputLabel> <h:inputSecret id="password" value="#{identity.password}"/> ...
After:... <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.ajax4jsf.org/rich" xmlns:my="http://my.com/jsf" template="layout/template.xhtml"> ... <my:field label="Username" fieldName="username" entity="#{identity}" /> <my:field label="Password" fieldName="password" entity="#{identity}" secret="true" /> ...
-
4. Re: JSF Composition Components with Seam
fernando_jmt May 16, 2007 9:32 AM (in response to nhpvti)I have this in my web.xml:
<context-param> <param-name>facelets.LIBRARIES</param-name> <param-value> /WEB-INF/facelets/myapp.taglib.xml </param-value> </context-param>
myapp.taglib.xml<?xml version="1.0"?> <!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "http://java.sun.com/dtd/facelet-taglib_1_0.dtd"> <facelet-taglib> <namespace>http://my.com/jsf/</namespace> <tag> <tag-name>dataScroller</tag-name> <source>tags/dataScroller.xhtml</source> </tag> </facelet-taglib>
And in the dataScroller.xhtml is located: WEB-INF/facelets/tags/dataScroller.xhtml
Then in my page (located anywhere) I have:<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" xmlns:rich="http://richfaces.ajax4jsf.org/rich" xmlns:app="http://my.com/jsf" template="/layout/template.xhtml"> .... <app:dataScroller dataTableId="userListId"/> .... </ui:composition>
And all is working OK.
HTH. -
5. Re: JSF Composition Components with Seam
nhpvti May 17, 2007 7:09 AM (in response to nhpvti)"fernando_jmt" wrote:
I have this in my web.xml:<context-param> <param-name>facelets.LIBRARIES</param-name> <param-value> /WEB-INF/facelets/myapp.taglib.xml </param-value> </context-param>
...
Finally I moved all my component stuff into /view/component/ and everything works as well :-)<context-param> <param-name>facelets.LIBRARIES</param-name> <param-value> /component/myapp.taglib.xml </param-value> </context-param>
-
6. Re: JSF Composition Components with Seam
cba2 Jun 21, 2007 7:15 AM (in response to nhpvti)I think it should work in any subfolder of WEB-INF. But you might have to adapt your build.xml (if you use ant) in order to ensure that the files are actually packaged into the .war file! Just have a look at the exploded-archives and ensure that your files are deployed in the correct location.