沉睡森林@漂在北京

本处文章除注明“转载”外均为原创,转载请注明出处。

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  152 随笔 :: 4 文章 :: 114 评论 :: 0 Trackbacks
下面是dtd文件:

<?xml version="1.0" encoding="UTF-8"?>

 
<!ENTITY % Boolean "(true|false|yes|no)">
<!ENTITY % Integer "CDATA">

<!ELEMENT struts-config (menu-path,description?, form-beans?,action-mappings?) >

<!ELEMENT menu-path  (#PCDATA)>
<!ELEMENT description (#PCDATA)>

<!ELEMENT form-beans (form-bean*)>

<!ELEMENT form-bean (description,form-property*)>

<!ATTLIST form-bean name  CDATA     #REQUIRED>

<!ELEMENT form-property EMPTY>
<!ATTLIST form-property prefix   CDATA     #REQUIRED>
<!ATTLIST form-property name     CDATA     #REQUIRED>
<!ATTLIST form-property type     CDATA     #IMPLIED>
<!ATTLIST form-property size     %Integer;      #IMPLIED>
<!ATTLIST form-property notnull    %Boolean;     #IMPLIED>
<!ATTLIST form-property initval     CDATA     #IMPLIED>
<!ATTLIST form-property description     CDATA     #IMPLIED>

<!ELEMENT action-mappings (action*)>

<!ELEMENT action (description?,forward*)>

<!ATTLIST action name CDATA #REQUIRED>
<!ATTLIST action className CDATA #REQUIRED>
<!ATTLIST action methodName CDATA #REQUIRED>
<!ATTLIST action path CDATA #REQUIRED>
<!ATTLIST action input CDATA #IMPLIED>
 
<!ELEMENT forward EMPTY>
<!ATTLIST forward name CDATA #REQUIRED>
<!ATTLIST forward path CDATA #REQUIRED>

 下面是对应的一个XML文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config SYSTEM "greatwall-struts.dtd">
<struts-config>
 <menu-path>/app/user/</menu-path>
 <description>用户处理Struts配置文件</description>
 
 <form-beans>
  <form-bean  name="userFormBean" >
   <description>用户登录表单处理</description>
   <form-property prefix="record" name="username" description="用户名"  notnull="true" size="16"  type="string" initval="admin"/>
   <form-property prefix="record" name="password" description="密码" />
  </form-bean>
 </form-beans>
 
 <action-mappings>
  <action methodName="listUser" className="com.greatwall.user.action.UserAction" name="userFormBean" path="/ListUser.do" >
   <description>用户列表</description>
   <forward name="success" path="listUser.jsp" />
   <forward name="failure" path="listUser.jsp" />
  </action>
  <action methodName="deleteUser" className="com.greatwall.user.action.UserAction" name="userFormBean" path="/deleteUser.do" >
   <description>删除用户</description>
   <forward name="success" path="listUser.jsp" />
   <forward name="failure" path="listUser.jsp" />
  </action>
  
 </action-mappings>
 
 
</struts-config>


不能松懈,困难很多,但是坚持就是胜利!

 

posted on 2008-10-22 21:55 王总兵 阅读(123) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: