tomcat发布web应用时的一个异常

tomcat发布web应用时的一个错误

在用tomcat发布一个web应用时,出现了这样一个错误:

 

The content of element type "struts-config" must match "(display-name?,description?,data-sources?,

form-beans?,global-exceptions?,global-forwards?,action-mappings?,controller?,message-resources*,

plug-in*)".

 

不知道是什么问题,在网上查了半天,才明白是什么原因。原来,struts-config.xml中的元素有严格的顺序,如果元素的顺序出错,系统会抛出上面的这样一个错误。

 

struts-config.xml必须按照display-name-->description-->datasources-->form-beans-->global-forwards

-->action-mappings-->controller-->message_resources-->plug-in的顺序书写。

 

而我原来的struts-config.xml中没有controller这一项,我给添加上时,放到message_resources后面去了,所以才会出现这样的错误。