首页 > 其他 > 详细

自定义标签异常错误汇总

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

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> 属性

自定义标签异常错误汇总

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!