Can't use captcha from tomahawk library
Question
I'm trying to use the captcha component from tomahawk, <t:captcha>
. Everytime the page loads, the following error appears:
com.sun.facelets.tag.TagException: /tiles/competitionSite.xhtml @112,46 Tag Library supports namespace: http://myfaces.apache.org/tomahawk, but no tag was defined for name: captcha
I think there's something wrong with the libraries. I checked the tomahawk JARs and <t:captcha>
should be supported in Tomahawk 1.1.7 or higher. I used multiple versions (e.g. 1.1.13), but <t:captcha>
never worked. All the other tags like <t:inputText>
are working fine. I also imported the batik-awt-util-1.6-1.jar
, because that's necessary for captchas.
Maybe there's a problem with my other libraries? I can't exchange them easily, because there are many dependencies. Here's a list of them:
batik-awt-util-1.6-1.jar
- commons-beanutils-1.7.0.jar
- commons-codec-1.3.jar
- commons-collections-3.1.jar
- commons-digester-1.6.jar
- commons-el-1.0.jar
- commons-lang-2.1.jar
- commons-validator-2.1.jar
- el-ri.jar
- jakarta-oro.jar
- jboss-serialization.jar
- jsf-facelets-1.1.12.jar
- jstl-1.1.0.jar
- myfaces-api-1.1.5.jar
- myfaces-impl-1.1.5.jar
- org.springframework.web-3.0.5.jar
- richfaces-api-3.1.6.GA.jar
- richfaces-impl-3.1.6.GA.jar
- richfaces-ui-3.1.6.GA.jar
tomahawk-1.1.13.jar
- urlrewrite-2.6.0.jar
Thanks for your help!
Solution
I just found the mistake. In our CMS the tomahawk.taglib.xml
file will not be deployed dynamically from the included JAR. I just had to create a new entry like this:
<tag>
<tag-name>captcha</tag-name>
<component>
<component-type>org.apache.myfaces.CAPTCHA</component-type>
<renderer-type>org.apache.myfaces.CAPTCHA</renderer-type>
</component>
</tag>
Now I use <t:captcha>
with tomahawk-1.1.7.jar and batik-awt-util-1.6-1.jar.