码迷,mamicode.com
首页 > 其他好文 > 详细

自定义标签异常错误汇总

时间:2018-06-03 22:19:10      阅读:277      评论:0      收藏:0      [点我收藏+]

标签:解决   增加   tag   param   方案   sim   com   图片   配置文件   

1、未设置empty 属性

  • 错误信息:

    严重: Servlet.service() for servlet [jsp] in context with path [/web-exercise] threw exception [/paramTag.jsp (line: 11, column: 0) The TLD for the class taglibclass.QueryTag specifies an invalid body-content (JSP) for a SimpleTag.] with root cause
    org.apache.jasper.JasperException: /paramTag.jsp (line: 11, column: 0) The TLD for the class taglibclass.QueryTag specifies an invalid body-content (JSP) for a SimpleTag.  
  • web页面截图:
    技术分享图片

  • tld配置:

    <tag>
        <name>paramTag</name>
        <tag-class>taglibclass.QueryTag</tag-class>
    
        <attribute>
            <name>driver</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>url</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>username</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>password</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>sql</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
    </tag>
  • 解决方案:在tld配置文件中增加:<body-content>empty</body-content> 属性

自定义标签异常错误汇总

标签:解决   增加   tag   param   方案   sim   com   图片   配置文件   

原文地址:https://www.cnblogs.com/caoleiCoding/p/9130716.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!