首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >jcaptcha与struts的集成

jcaptcha与struts的集成
EN

Stack Overflow用户
提问于 2010-04-15 00:49:00
回答 1查看 1.6K关注 0票数 1

我正在尝试使用jcaptcha -1.0开发一个struts 1.3.8应用程序;我将jcaptcha jar添加到了应用程序库中,并添加了

代码语言:javascript
复制
<%@ taglib uri="jcaptcha" prefix="jcaptcha"%>

发送到我的表单

应用程序找不到该文件,因此我在web.xml文件中添加了以下内容

代码语言:javascript
复制
<taglib-uri>jcaptcha</taglib-uri>
<taglib-location>/WEB-INF/lib/jcaptcha-1.0-all.jar</taglib-location>
</taglib>

现在我得到了空指针异常:

代码语言:javascript
复制
org.apache.jasper.JasperException: Unable to read TLD "META-INF/taglib.tld" from JAR file 

有什么线索吗?欢迎关于使用struts的其他验证码的建议。

谢谢

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-06-24 02:25:41

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

如果失败,请尝试<%@ taglib uri="/WEB-INF/jcaptcha.tld" prefix="jcaptcha"%>并在WEB-INF中创建包含以下内容的jcaptcha.tld文件:

代码语言:javascript
复制
<?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>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2639299

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档