代码如下:
<?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>".

解决方案 »

  1.   

    把<data-sources />去了看看!应该就差不多了吧
      

  2.   

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

  3.   

    大哥那个 <action-mappings />多了一个/
      

  4.   

     <action-mappings />多了一个/
      

  5.   

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

  6.   

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

  7.   

    xml格式错误
    <action-mappings />表示标签已经结束了,但是里面还包含了内容,所以无法解析。解决方案:
    <action-mappings />
    改为
    <action-mappings>
      

  8.   

    <form-beans />
      <form-bean name="loginForm" type="com.ssh.struts.form.LoginForm" />
      </form-beans> //报错行!不要斜杠就行了。这样写不符合XML的标准……