代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"><struts-config><data-sources /> <form-beans />
<form-bean name="loginForm" type="com.ssh.struts.form.LoginForm" />
</form-beans> //报错行! <action-mappings />
<action
attribute="loginForm"
input="/login.jsp"
name="loginForm"
path="/login"
scope="request"
type="com.ssh.struts.action.LoginAction" >
<forward name="suc" path="/index.jsp" />
</action>
</action-mappings></struts-config>报错信息:The element type "struts-config" must be terminated by the
matching end-tag "</struts-config>".
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"><struts-config><data-sources /> <form-beans />
<form-bean name="loginForm" type="com.ssh.struts.form.LoginForm" />
</form-beans> //报错行! <action-mappings />
<action
attribute="loginForm"
input="/login.jsp"
name="loginForm"
path="/login"
scope="request"
type="com.ssh.struts.action.LoginAction" >
<forward name="suc" path="/index.jsp" />
</action>
</action-mappings></struts-config>报错信息:The element type "struts-config" must be terminated by the
matching end-tag "</struts-config>".
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"><struts>
<form-beans />
<form-bean name="loginForm" type="com.ssh.struts.form.LoginForm" />
<action-mappings >
<action
attribute="loginForm"
input="/login.jsp"
name="loginForm"
path="/login"
scope="request"
type="com.ssh.struts.action.LoginAction" >
<forward name="suc" path="/index.jsp" />
</action>
</action-mappings></struts>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"><struts-config><data-sources /><form-beans>
<form-bean name="loginForm" type="com.ssh.struts.form.LoginForm" />
</form-beans>
<action-mappings>
<action
attribute="loginForm"
input="/login.jsp"
name="loginForm"
path="/login"
scope="request"
type="com.ssh.struts.action.LoginAction" >
<forward name="suc" path="/index.jsp" />
</action>
</action-mappings>
</struts-config>
attribute="loginForm"
input="/login.jsp"
name="loginForm"
path="/login"
scope="request"
type="com.ssh.struts.action.LoginAction" >
<forward name="suc" path="/index.jsp" />
</action>
</action-mappings>
<action-mappings />表示标签已经结束了,但是里面还包含了内容,所以无法解析。解决方案:
<action-mappings />
改为
<action-mappings>
<form-bean name="loginForm" type="com.ssh.struts.form.LoginForm" />
</form-beans> //报错行!不要斜杠就行了。这样写不符合XML的标准……