解析错误处理资源路径jndi:/localhost/StrutsDataExport/WEB-INF/struts-config.xml

时间:2012-08-31 11:01:31

标签: java struts

您在启动服务器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,请帮我解决这个问题

此致

1 个答案:

答案 0 :(得分:0)

亚历克斯提到第一个问题是由一个尾随的“ - &gt;”

引起的

第二个错误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声明为

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

而不是

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