struts-config.xml配置文件出错的问题及其解决

出错的信息大概有以下一些:

The content of element type "action-mappings" must match "(action)*".

The content of element type "struts-config" must match "(data-sources?,form-beans?,global-exceptions?,global-forwards?,action-mappings?,controller?,message-resources*

Element type "action" must be followed by either attribute specifications, ">" or "/>".

=====================================================================

解决的办法:

①struts-config.xml中的配置顺序:

1、display-name

2、description

3、data-sources

4、form-beans

5、global-exceptions

6、global-forwards

7、action-mappings

8、controller

9、message-resources*

10、plug-in*

②关于顺序不对:

<set-property property="" value="true" />

<forward name="" path="/index.jsp" />

注意他们都在<action></action>的里面。

③关于空格的问题

<action  name="" path=""  scope="request"  type="">
   <forward  name=""  path=""></forward>
   </action>

name、path、scope、type之间一定要有空格。

 

学识浅薄,希望能帮到出错的初学者。

    

 

你可能感兴趣的:(struts-config.xml配置文件出错的问题及其解决)