首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

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

2012-05-27 
sh框架的structs-config.xml报错代码如下:?xml version1.0 encodingUTF-8?!DOCTYPE struts-confi

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>

应该是这样子才对 检查下吧

热点排行