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

struts报错,该怎么解决

2012-02-03 
struts报错?xml version1.0 encodingUTF-8?!DOCTYPE struts-config PUBLIC -//Apache Software

struts报错
<?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>

 <!-- formBean组件 -->
  <form-beans>
  <form-bean name="loginFormBean" type="formBean.loginFormBean"/>
  <form-bean name="addInfoFormBean" type="formBean.addInfoFormBean"/>
  <form-bean name="addThingFormBean" type="formBean.addThingFormBean"/>
  <form-bean name="addArraFormBean" type="formBean.addArraFormBean"/>
  <form-bean name="arraMeFormBean" type="formBean.arraMeFormBean"/>
  <form-bean name="addUserFormBean" type="fromBean.addUserFormBean"/>
  <form-bean name="modiUserFormBean" type="formBean.modiUserFormBean"/>
  <form-bean name="modiPassFormBean" type="formbean.modiPassFormBean"/>
  <form-bean name="addDepartFormBean" type="formBean.addDepartBean"/>
  </form-beans>
  
  
  <action-mappings>

  <!-- 登录系统 -->
  <action path="/checkLogin" name="loginFormBean" type="action.loginAction"
  validate="true" input="/user/login.jsp">
  </action>
  
  <!-- 进入增加一个新用户页面 -->
  <action path="/enterAddUser" type="action.enterAddUserAction"></action>
  <!-- 增加一个新用户 -->
  <action path="/addUser" name="addUserFormBean" type="action.addUserAction"
  validate="true" input="/user/addUser1.jsp">
  <forward name="addUserSuccessJSP" path="/user/addUser2.jsp"/>
  </action>
  <!-- 显示用户列表 -->
  <action path="/viewUserList" type="action.viewUserListAction"></action>
  <!-- 进入修改用户信息页面 -->
  <action path="/viewUserInfo" type="action.viewUserInfoAction"></action>
  <!-- 修改用户信息 -->
  <actioin path="/modiUser" name="modiUserFormBean" type="action.modiUserAction"
  validate="true" input="/user/modiUser2.jsp">
  <forward name="modiUserSuccessJSP" path="/user/modiUser3.jsp"/>
  </actioin>
  <!-- 删除一个用户 -->
  <action path="/delUser" type="action.delUserAction">
  <forward name="modiUserSuccessJSP" path="/user/modiUser3.jsp"/>
  </action>
  <!-- 修改用户密码 -->
  <action path="/modiPass" name="modiPassFormBean" type="action.modiPassAction"
  validate="true" input="/user/modiPass1.jsp">
  <forward name="modiPassSuccessJSP" path="/user/modiPass2.jsp"/>
  <forward name="modiPassJSP" path="/user/modiPass1.jsp"/>
  </action>
  <!-- 进入公司部门管理页面 -->
  <action path="/viewDepartList" type="action.viewDeparListAction"> </action>
  <!-- 增加一个部门 -->
  <action path="/addDepart" name="addDepartFormBean" type="action.addDepartAction"
  validate="true" input="/user/department.jsp"></action>
  <!-- 删除一个部门 -->


  <action path="/delDepart" type="action.delDepartAction"></action>
  <!-- ===消息管理模块=== -->
  <!-- 查看信息列表 -->
  <action path="/viewInfo" type="action.viewInfoAction"></action>
  <!-- 查看具体信息 -->
  <action path="/viewInfo2" type="action.viewInfoAction2"></action>
  <!-- 删除一条信息 -->
  <action path="/delInfo" type="action.delInfoAction">
  <forward name="delInfoJSP" path="/info/delInfo.jsp"/>
  </action>  
  <!-- 增加一条信息 -->
  <action path="/addInfo" name="addInfoFormBean" type="action.addInfoAction"
  validate="true" input="/info/addInfo1.jsp">
  <forward name="addInfo1JSP" path="/info/addInfo1.jsp"/>
  <forward name="addInfo2JSP" path="/info/addInfo2.jsp"/>
  </action>
  
  <!--===审批事务管理模块===-->
  
 <!--增加一条审批事务 -->
 <action path="/addThing" name="addThingFormBean" type="action.addThingAction"
 validate="true" input="/man/addThing1.jsp">
 <forward name="addThing1JSP" path="/man/addThing1.jsp"/>
 <forWard name="addThing2JSp" path="/man/addThing2.jsp"/>
 </action>
  
  <!-- 查看审批事务列表 -->
  <action path="/viewThingList" type="action.viewThingListAction"></action>
  <!-- 查看我的审批事务列表 -->
  <action path="/viewMeThingList" type="action.enterThingToMeAction"></action>
  <!-- 删除一个审批事务 -->
  <action path="/delThing" type="action.delThingAction"></action>
  <!-- 查看具体的审批事务信息 -->
  <action path="/viewThing" type="action.viewThingAction"></action>
  <!-- 安排审批 -->
  <action path="/thingArra" type="action.thingArraAction"></action>
  <!-- 进入增加一个审批过程的页面 -->
  <action path="/enterAddArra" type="action.enterAddArraAction"></action>
  <!-- 增加一个审批过程 -->
  <action path="/addArra" name="addArraFormBean" type="action.addArraAction"
  validate="true" input="/man/thingArra2.jsp"></action>
  <!-- 删除一个审批过程 -->
  <action path="/delArra" type="action.delArraAction"></action>
  <!-- 进入审批页面 -->
  <action path="/enterArrMe" type="action.enterarraMeAction">
  <forward name="enterArraMeJSP" path="/man/thingToMe2.jsp"/></action>
  <!-- 审批 -->
  <action path="/arraMe" name="arraMeFormBean" type="action.arraMeAction"
  validate="true" input="/man/thingToMe2.jsp">
  <forward name="arraMeSuccessJSP" path="/man/thingToMe3.jsp"/>
  </action>
  
  </action-mappings>
  
  <!-- <global-exceptions /> -->
  <!-- <global-forwards /> -->
  <global-forwards>
  <forward name="firstJSP" path="/index.jsp"/>
  <forward name="viewInfoJSP" path="/info/viewInfo1.jsp"/>
  <forward name="viewInfodo" path="/viewInfo.do"/>


  <forward name="viewInfo2JSP" path="/info/viewInfo2.jsp"/>
  <forward name="viewThingListJSP" path="/man/thingArra1.jsp"/>
  <forward name="viewThingListdo" path="/viewThingList.do"/>
  <forward name="viewThingJSP" path="/man/manRecord.jsp"/>
  <forward name="enterAddArraJSP" path="/man/thingArra2.jsp"/>
  <forward name="enterAddArrado" path="/enterAddArra.do"/>
  <forward name="viewMeThingListdo" path="/viewMeThingLIst.do"/>
  <forward name="viewMeThingListJSP" path="/man/tingToMe1.jsp"/>
  <forward name="enterAddUserJSP" path="/user/addUser1.jsp"/>
  <forward name="viewUserListJSP" path="/usr/modiUser1.jsp"/>
  <forward name="viewUserListdo" path="/viewUserList.do"/>
  <forward name="modiUserJSP" path="/user/modiUser2.jsp"/>
  <forward name="enterDepartmentJSP" path="/user/department.jsp"/>
  <forward name="enterDepartmentdo" path="/viewDepartList.do"/>
  </global-forwards>
 <!-- <action-mappings /> -->
  <message-resources parameter="com.yourcompany.struts.ApplicationResources" />
</struts-config>


The content of element type "struts-config" must match "(display-name?,description?,data-
 sources?,form-beans?,global-exceptions?,global-forwards?,action-mappings?,controller?,message-
 resources*,plug-in*)".

The content of element type "action-mappings" must match "(action)*".

The content of element type "action" must match "(icon?,display-name?,description?,set-
 property*,exception*,forward*)".

这个是报错的部分,找不到错在哪,高手帮下忙。

[解决办法]
全局跳转应该放在action-mappings的前面
[解决办法]
最后两个还是报的话应该是这句的问题
<!-- 修改用户信息 -->
<actioin path="/modiUser" name="modiUserFormBean" type="action.modiUserAction"
validate="true" input="/user/modiUser2.jsp">
<forward name="modiUserSuccessJSP" path="/user/modiUser3.jsp"/>
</actioin>

改成
<action path="/modiUser" name="modiUserFormBean" type="action.modiUserAction"
validate="true" input="/user/modiUser2.jsp">
<forward name="modiUserSuccessJSP" path="/user/modiUser3.jsp"/>
</action>
[解决办法]
display-name?,description?,data-
 sources?,form-beans?,global-exceptions?,global-forwards?,action-mappings?,controller?,message-
 resources*,plug-in*)".


<global-forwards>放在action-mappings的前面
 注意对象组的前后顺寻

热点排行