jcaptcha integration with struts
I'm trying to interate a struts 1.3.8 app with jcaptcha-1.0; I added the jcaptcha jar to the app lib and added
<%@ taglib uri="jcaptcha" prefix="jcaptcha"%>
to开发者_C百科 my form
The app couldn't find the file, so I added the following to the web.xml file
<taglib-uri>jcaptcha</taglib-uri>
<taglib-location>/WEB-INF/lib/jcaptcha-1.0-all.jar</taglib-location>
</taglib>
And now I get the null pointer exception:
org.apache.jasper.JasperException: Unable to read TLD "META-INF/taglib.tld" from JAR file
Any clues ? Recommendations about otther captchas that work with struts are welcomed.
Thanks
Try <%@ taglib uri="http://jcaptcha.sourceforge.net" prefix="jcaptcha" %>
If that fails, try <%@ taglib uri="/WEB-INF/jcaptcha.tld" prefix="jcaptcha"%>
and create the jcaptcha.tld
file in WEB-INF
with this content:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--
~ JCaptcha, the open source java framework for captcha definition and integration
~ Copyright (c) 2007 jcaptcha.net. All Rights Reserved.
~ See the LICENSE.txt file distributed with this package.
-->
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems,
Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>jcaptcha-struts-taglib</shortname>
<uri>http://jcaptcha.sourceforge.net</uri>
<info>JCAPTCHA Taglib for the base module</info>
<tag>
<name>question</name>
<tagclass>com.octo.captcha.module.struts.taglib.QuestionTag</tagclass>
<bodycontent>empty</bodycontent>
<info>Display the jcaptcha question for this session</info>
</tag>
<tag>
<name>message</name>
<tagclass>com.octo.captcha.module.taglib.MessageTag</tagclass>
<bodycontent>empty</bodycontent>
<info>Display the jcaptcha failure message for this session</info>
</tag>
</taglib>
精彩评论