【问题标题】:Warning in eclipse tiles project日食瓷砖项目中的警告
【发布时间】:2011-07-08 04:07:19
【问题描述】:

我正在开发一个瓷砖应用程序。当我使用瓷砖标签插入时,它无法识别。我收到这样的警告:未知标签(tiles:insert)

我的 jsp 页面如下所示:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO 8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
        <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
        <html>
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        </head>
            <body>
                <table border="1" cellpadding="2" cellspacing="2" align="center">
                    <tr>
                        <td>
                            <tiles:insert attribute="body" />
                        </td>
                    </tr>
                </table>
            </body>
        </html>

我也在使用 Struts2,但这些标签是可以识别的。 我的 web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 
    <display-name>Struts2 Application</display-name>
    <listener>
        <listener-class>
            org.apache.struts2.tiles.StrutsTilesListener
        </listener-class>
    </listener>
    <context-param>
        <param-name>tilesDefinitions</param-name>
        <param-value>/WEB-INF/tiles.xml</param-value>
    </context-param>

    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>
            org.apache.struts2.dispatcher.FilterDispatcher
        </filter-class>
    </filter>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern></url-pattern>
    </filter-mapping>
    <welcome-file-list>
        <welcome-file>baseLayout.jsp</welcome-file>
    </welcome-file-list>
    <jsp-config> 
        <taglib>
             <taglib-uri>/tags/struts-tiles</taglib-uri>
             <taglib-location>http://struts.apache.org/tags-tiles</taglib-location>
        </taglib>
    </jsp-config> 
</web-app>

我的罐子:

commons-beanutils-1.8.0.jar
commons-digester-1.8.1.jar
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-logging-1.1.jar
freemarker-2.3.13.jar
junit-3.8.1.jar
ognl-2.6.11.jar
struts2-convention-plugin-2.1.6.jar
struts2-core-2.1.6.jar
struts2-tiles-plugin-2.1.6.jar
tiles-api-2.1.2.jar
tiles-compat-2.1.2.jar
tiles-core-2.1.2.jar
tiles-jsp-2.1.2.jar
tiles-servlet-2.1.2.jar
xwork-2.1.2.jar

我错过了什么吗?

【问题讨论】:

  • Eclipse 显示这种类型的错误,unknown tags,只要它运行顺利,您可以忽略 this 警告

标签: java eclipse frameworks struts tiles


【解决方案1】:

这是版本问题。 正确的是使用:&lt;tiles:insertAttribute name="body" /&gt; 不是:&lt;tiles:insert attribute="body" /&gt;

【讨论】:

    猜你喜欢
    • 2019-03-12
    • 2010-09-15
    • 1970-01-01
    • 2018-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多