-
1. Problem with writing Custom Components
ilya40umov Mar 4, 2011 3:38 AM (in response to j.v.)1) I suppose you have already read something like this article:
http://www.ibm.com/developerworks/java/library/j-facelets/
I just wanted to pointed out on this one because it's very clear and detailed.
2) Are you using jsf 1.2?
3) Have you declared library "http://myconfirmdialog.com/richx" with prefix "richx" in your xhtml page? Please provide a full sample of your page.
4) Where did you place "
mytag-taglib.xml"?
-
2. Problem with writing Custom Components
j.v. Mar 4, 2011 7:21 AM (in response to ilya40umov)Hi Ilya,
1) You're right, i've read some articles and tutorials. I tried to do the same as in the tutorials, but the problem stays.
2) Yes, I'm using jsf 1.2
3) I have declared the richx prefix
4) I've placed my mytag-taglib.xml in the WEB-INF directory. I've tried other locations like META-INF without any result.
-
3. Problem with writing Custom Components
ilya40umov Mar 4, 2011 8:40 AM (in response to j.v.)Well. I have the following and it works fine:
<context-param>
<param-name>facelets.LIBRARIES</param-name>
<param-value>
/WEB-INF/facelets/tags/my.taglib.xml;
</param-value>
</context-param>
In WEB-INF/facelets/tags/my.taglib.xml
<?xml version="1.0"?>
<!DOCTYPE facelet-taglib PUBLIC
"-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
"facelet-taglib_1_0.dtd">
<facelet-taglib>
<namespace>http://www.my.com/jsf</namespace>
<tag>
<tag-name>myTag</tag-name>
<source>myTag.xhtml</source>
</tag>
</facelet-taglib>
My myTag.xhtml is placed in
WEB-INF/facelets/tags/
And it looks like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.og/TR/xhtml1/DTD/xhtml-transitionl.dtd">
<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:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:fn="http://java.sun.com/jsp/jstl/functions">
<ui:composition>
... my tag content...
</ui:composition>
</html>
And then it works fine on my facelets pages.
Which version of facelets are you using?
-
4. Problem with writing Custom Components
j.v. Mar 9, 2011 9:14 AM (in response to ilya40umov)Hi Ilya,
I use facelets version 1.1.15.
I implemented my custom component exactly like yours, but it doesn't work.
-
5. Problem with writing Custom Components
j.v. Mar 24, 2011 6:36 AM (in response to j.v.)Does anybody know a solution?
-
6. Problem with writing Custom Components
nbelaevski Mar 24, 2011 9:57 AM (in response to j.v.)So, does this:
<context-param>
<param-name>facelets.LIBRARIES</param-name>
<param-value>mytag-taglib.xml</param-value>
</context-param>points to the correct location including WEB-INF etc?
-
7. Problem with writing Custom Components
j.v. Mar 24, 2011 10:20 AM (in response to nbelaevski)Yes, the it points to the right location.
I've tried different locations, but no one worked.