0

嗨,我在启动服务器时遇到以下异常tomcat 6.0

SEVERE: Parsing error processing resource path jndi:/localhost/StrutsDataExport/WEB-INF/struts-config.xml
org.xml.sax.SAXParseException: Content is not allowed in trailing section.

这就是我的struts-config.xml

`

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">

<struts-config>
    <form-beans>
        <form-bean name="UserForm" type="com.report.UserForm" />
    </form-beans>

    <global-exceptions>

    </global-exceptions>

    <global-forwards>
        <forward name="welcome" path="/Welcome.htm" />
    </global-forwards>

    <action-mappings>
        <action input="/" name="UserForm" path="/userAction" scope="session"
            type="com.report.UserAction">
            <forward name="success" path="/user.jsp" />
        </action>
        <action path="/Welcome" forward="/welcomeStruts.jsp"/>
    </action-mappings>

    <controller processorClass="org.apache.struts.tiles.TilesRequestProcessor" />

    <message-resources parameter="com/report/ApplicationResource" />


    <plug-in className="org.apache.struts.tiles.TilesPlugin">
        <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
        <set-property property="moduleAware" value="true" />
    </plug-in>

    <!--
        ========================= Validator plugin
        =================================
    -->
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
        <set-property property="pathnames"
            value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
    </plug-in>

</struts-config>
    -->
`

我收到异常说我在 struts-config 文件中有问题但我无法找到,这就是为什么我在部署时遇到上述异常,我正在使用 netbeans IDE,请帮我解决这个问题

问候

4

1 回答 1

0

正如亚历克斯提到的,第一个问题是由尾随的“-->”引起的

第二个错误org.apache.jasper.JasperException: The absolute uri: http://displaytag.sf.net cannot be resolved in either web.xml or the jar files deployed with this application 是由错误的 taglib uri 声明引起的。

解决方案是这样声明标签库

<%@ taglib uri="http://displaytag.sf.net/el" prefix="display" %>

代替

<%@ taglib uri="http://displaytag.sf.net/" prefix="display" %>
于 2017-05-24T13:49:53.823 回答