当前位置: 代码迷 >> Java Web开发 >> sh框架的structs-config.xml报错,该如何处理
  详细解决方案

sh框架的structs-config.xml报错,该如何处理

热度:7553   发布时间:2013-02-25 21:19:38.0
sh框架的structs-config.xml报错
代码如下:
<?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>


</struts-config>

报错提示:The content of element type "struts-config" must match "(displayname?,description?,datasources?,form-beans?,global-exceptions?,global-forwards?,action-mappings?,controller?,message-resources*,plug-in*)".

------解决方案--------------------------------------------------------
</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>



你的这个地方应该改成
</form-beans>
<global-exceptions />
<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>

应该是这样子才对 检查下吧
  相关解决方案
本站暂不开放注册!
内测阶段只得通过邀请码进行注册!
 
  • 最近登录:Sun Jun 24 03:28:55 CST 2018
  • 最近登录:Sun Jun 24 03:28:55 CST 2018
  • 最近登录:Sun Jun 24 03:28:55 CST 2018
  • 最近登录:Sun Jun 24 03:28:55 CST 2018
  • 最近登录:Sun Jun 24 03:28:55 CST 2018