struts-config-xml配置问题

来源:百度知道 编辑:UC知道 时间:2024/06/01 13:49:24
<?xml version="1.0" encoding="ISO-8859-1" ?>

<!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>

<action-mappings>
<action path="/beanWrite"
type="com.bjsxt.struts.TestBeanWriteAction"
>
<forward name="success" path="/success.jsp"></forward>
</action>
</action-mappings>
<action-mappings>
<action path="/logic"
type="com.bjsxt.struts.LogicEmptyPresentAction"
>
<forward name="success1" path="/emptypresent.jsp"/>
</act

xml格式校验有错。你的错误是说定义这些标签是有顺序的.顺序就是:display-name?,description?,data-sources?,form-beans?,global-exceptions?,global-forwards?,action-mappings?,controller?,message-resources*,plug-in*,既所有的display-name标签 在 description标签之前,所有的description标签 在data-sources标签之前...。别人的不出错可能是关闭了校验或者校验的方法不一样,在servlet2.3中dtd校验,而在servlet2.4中不使用DTD校验,而使用xml-schema