2010-04-14 4 views
1

Я пытаюсь вставить приложение struts 1.3.8 с jcaptcha-1.0; Я добавил jcaptcha банки в приложении Lib и добавилjcaptcha интеграция со стойками

<%@ taglib uri="jcaptcha" prefix="jcaptcha"%> 

к моей форме

приложение не может найти файл, так что я добавил следующее в файл web.xml

<taglib-uri>jcaptcha</taglib-uri> 
<taglib-location>/WEB-INF/lib/jcaptcha-1.0-all.jar</taglib-location> 
</taglib> 

А теперь я получаю исключения нулевого указателя:

org.apache.jasper.JasperException: Unable to read TLD "META-INF/taglib.tld" from JAR file 

Любые улики? Приветствуются рекомендации о других капчах, которые работают со стойками.

Благодаря

ответ

2

Try <%@ taglib uri="http://jcaptcha.sourceforge.net" prefix="jcaptcha" %>

Если это не удается, попробуйте <%@ taglib uri="/WEB-INF/jcaptcha.tld" prefix="jcaptcha"%> и создают jcaptcha.tld файл в WEB-INF с этим содержимым:

<?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> 
Смежные вопросы