一時手賤,把structs-config.xml文件中的一段話刪了,結果老是報錯。
報錯內容:Document is invalid: no grammar found
[html]
<?xml version="1.0" encoding="UTF-8"?>
<strong><span style="color:#ff0000;"><!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 1.3//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_3.dtd"></span></strong>
<struts-config>
<form-beans>
<form-bean name="helloForm" type="com.mars.demo01.structs01.form.HelloForm" />
</form-beans>
<!-- 用於配置ActionForm -->
<global-exceptions /><!-- 用於配置全局異常 -->
<global-forwards /><!-- 用於配置全局跳轉 -->
<action-mappings>
<action attribute="helloForm" input="/demo01/demo01_hello.jsp"
name="helloForm" path="/demo01/demo01_hello" scope="request"
type="com.mars.demo01.structs01.action.HelloAction" cancellable="true">
<forward name="show" path="/demo01/demo01_hello.jsp"></forward>
</action> www.2cto.com
</action-mappings>
<!-- 用於配置Action -->
<message-resources parameter="com.mars.demo01.structs01.ApplicationResources" />
</struts-config>
然後恢復原樣,結果又好了,所以這句話是不能刪的。在網上查了查,發現這是一個定義格式的東東。怎麼弄的這麼麻煩。