以前缀“logic”导入的标签库中没有定义标签“iterator”

问题描述 投票:0回答:1
Error: javax.servlet.ServletException: org.apache.jasper.JasperException: /ArrayList.jsp(9,2) No tag "iterator" defined in tag library imported with prefix "logic"
    org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
    org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:770)

这里我包含了我的

web.xml
文件:

<web-app>
    <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-Param>
            <param-name>config</param-name>
            <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-Param>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>  
    
    <taglib>
     <taglib-uri>
      http://struts.apache.org/tags-bean
     </taglib-uri>
     <taglib-location>
      /WEB-INF/struts-bean.tld
     </taglib-location>
</taglib>
<taglib>
     <taglib-uri>
      http://struts.apache.org/tags-html
     </taglib-uri>
     <taglib-location>
      /WEB-INF/struts-html.tld
     </taglib-location>
</taglib>
<taglib>
     <taglib-uri>
      http://struts.apache.org/tags-logic
     </taglib-uri>
     <taglib-location>
      /WEB-INF/struts-logic.tld
     </taglib-location>
</taglib>
</web-app>
java jsp struts struts-1 taglib
1个回答
1
投票

在 URL

http://struts.apache.org/tags-logic
定义的 TLD 中没有标签
iterator
。有
iterate
标签名称。如果您使用自定义 tld,则应在 taglib 标记和 tld 文件中指定不同的 URI。

<taglib>
     <taglib-uri>
      /tags-logic
     </taglib-uri>
     <taglib-location>
      /WEB-INF/struts-logic.tld
     </taglib-location>
</taglib>

在JSP中使用导入

<%@ taglib uri="/tags-logic" prefix="logic" %>
© www.soinside.com 2019 - 2024. All rights reserved.