posts - 18,  comments - 1,  trackbacks - 0


          <%@page contentType="text/html;charset=gbk" %>
          <%@taglib uri="

          <h3 align="center">Dispatch Action</h3>
          <hr>
          <pre>
          ??? 根據請求中的某個(1)參數的值來調用Action的方法(2)。
          ??? (1)參數名字在&lt;action parameter="method" /&gt;
          ??? (2)方法名字為 method 參數的值。
          </pre>
          <center>
          <a href="${pageContext.request.contextPath}/dispatch.do?method=login">login</a>&nbsp;&nbsp;&nbsp;
          <a href="${pageContext.request.contextPath}/dispatch.do?method=find">find</a>&nbsp;&nbsp;&nbsp;
          <a href="${pageContext.request.contextPath}/dispatch.do?method=findById">findById</a>&nbsp;&nbsp;&nbsp;
          <a href="${pageContext.request.contextPath}/dispatch.do?method=register">register</a>&nbsp;&nbsp;&nbsp;
          <a href="${pageContext.request.contextPath}/dispatch.do?method=remove">remove</a>&nbsp;&nbsp;&nbsp;
          <a href="${pageContext.request.contextPath}/dispatch.do?method=modify">modify</a>
          </center>
          <hr>
          <h3 align="center">LookupDispatch Action</h3>
          <hr>
          <pre>???
          </pre>
          <center>
          <form method="post" action="${pageContext.request.contextPath}/lookup.do">
          ??? <input type="submit" value="<bean:message key="submit.login"/>" name="method">
          ??? <input type="submit" value="<bean:message key="submit.find"/>" name="method">
          ??? <input type="submit" value="<bean:message key="submit.findById"/>" name="method">
          ??? <input type="submit" value="<bean:message key="submit.register"/>" name="method">
          ??? <input type="submit" value="<bean:message key="submit.remove"/>" name="method">
          ??? <input type="submit" value="<bean:message key="submit.modify"/>" name="method">
          </form>
          </center>
          <!--
          <h3 align="center">LookupDispatch Action</h3>
          <hr>
          <pre>???
          </pre>
          <center>
          <form method="post" action="${pageContext.request.contextPath}/lookup.do">
          ???
          ??? <input type="hidden" name="method" value="login">
          ???
          ??? <input type="submit" value="login" name="m" onclick="this.form.method.value='login'">
          ??? <input type="submit" value="find" name="m" onclick="this.form.method.value='find'">
          ??? <input type="submit" value="findById" name="m" onclick="this.form.method.value='findById'">
          ??? <input type="submit" value="register" name="m" onclick="this.form.method.value='register'">
          ??? <input type="submit" value="remove" name="m" onclick="this.form.method.value='remove'">
          ??? <input type="submit" value="modify" name="m" onclick="this.form.method.value='modify'">
          </form>
          </center>
          -->
          <hr>
          <h3 align="center">MappingDispatch Action</h3>
          <hr>
          <pre>
          ??? 根據<action>標記的parameter屬性的值來調用Action的方法(1)。
          ??? (1)方法名字為 parameter屬性的值。
          </pre>
          <center>
          <a href="${pageContext.request.contextPath}/mapping/login.do">login</a>&nbsp;&nbsp;&nbsp;
          <a href="${pageContext.request.contextPath}/mapping/find.do">find</a>&nbsp;&nbsp;&nbsp;
          <a href="${pageContext.request.contextPath}/mapping/findById.do?id=1">findById</a>&nbsp;&nbsp;&nbsp;
          <a href="${pageContext.request.contextPath}/mapping/register.do">register</a>&nbsp;&nbsp;&nbsp;
          <a href="${pageContext.request.contextPath}/mapping/remove.do?id=2">remove</a>&nbsp;&nbsp;&nbsp;
          <a href="${pageContext.request.contextPath}/mapping/modify.do">modify</a>
          </center>







          =====================================================

          <?xml version="1.0" encoding="gb2312" ?>

          <!DOCTYPE struts-config PUBLIC
          ????????? "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
          ????????? "

          <struts-config>

          ??? <form-beans>
          ??????? <form-bean name="loginForm" type="com.allanlxf.action.LoginForm"/>
          ??????? <form-bean name="userForm" type="org.apache.struts.action.DynaActionForm">
          ??????????? <form-property name="userName" type="java.lang.String" />
          ??????????? <form-property name="password" type="java.lang.String" />
          ??????? </form-bean>
          ??? </form-beans>
          ???
          ??? <action-mappings>
          ???
          ??????? <action?? path="/core/login"? type="com.allanlxf.action.LoginAction"
          ?????????????????? name="loginForm" input="/core/login.jsp" validate="true" scope="request">
          ????????? <exception key="errors.root"
          ?????????????????????? path="/core/error.jsp"
          ?????????????????????? type="com.allanlxf.biz.IllegalUserException" />
          ????????? <forward name="success" path="/core/success.jsp" redirect="true"/>
          ????????? <forward name="fail" path="/core/fail.jsp" />
          ??????? </action>
          ???????
          ??????? <action?? path="/dispatch"? type="com.allanlxf.struts.actions.UserAction" parameter="method">
          ????????? <forward name="login" path="/actions/pages/login_next.jsp" />
          ????????? <forward name="find" path="/actions/pages/find_next.jsp" />
          ????????? <forward name="findById" path="/actions/pages/findById_next.jsp" />
          ????????? <forward name="remove" path="/actions/pages/remove_next.jsp" />
          ????????? <forward name="modify" path="/actions/pages/modify_next.jsp" />
          ????????? <forward name="register" path="/actions/pages/register_next.jsp" />
          ??????? </action>
          ???????
          ??????? <action?? path="/mapping/login"? type="com.allanlxf.struts.actions.UserMappingAction" parameter="login">
          ????????? <forward name="next" path="/actions/pages/login_next.jsp" />
          ??????? </action>
          ???????
          ??????? <action?? path="/mapping/find"? type="com.allanlxf.struts.actions.UserMappingAction"? parameter="find">
          ????????? <forward name="next" path="/actions/pages/find_next.jsp" />
          ??????? </action>
          ???????
          ??????? <action?? path="/mapping/findById"? type="com.allanlxf.struts.actions.UserMappingAction"? parameter="findById">
          ????????? <forward name="next" path="/actions/pages/findById_next.jsp" />
          ??????? </action>
          ???????
          ??????? <action?? path="/mapping/remove"? type="com.allanlxf.struts.actions.UserMappingAction"? parameter="remove">
          ????????? <forward name="next" path="/actions/pages/remove_next.jsp" />
          ??????? </action>
          ???????
          ??????? <action?? path="/mapping/modify"? type="com.allanlxf.struts.actions.UserMappingAction"? parameter="modify">
          ????????? <forward name="next" path="/actions/pages/modify_next.jsp" />
          ??????? </action>
          ???????
          ??????? <action?? path="/mapping/register"? type="com.allanlxf.struts.actions.UserMappingAction"? parameter="register">
          ????????? <forward name="next" path="/actions/pages/register_next.jsp" />
          ??????? </action>
          ???????
          ??????? <action?? path="/lookup"? type="com.allanlxf.struts.actions.UserLookupAction" parameter="method">
          ????????? <forward name="login" path="/actions/pages/login_next.jsp" />
          ????????? <forward name="find" path="/actions/pages/find_next.jsp" />
          ????????? <forward name="findById" path="/actions/pages/findById_next.jsp" />
          ????????? <forward name="remove" path="/actions/pages/remove_next.jsp" />
          ????????? <forward name="modify" path="/actions/pages/modify_next.jsp" />
          ????????? <forward name="register" path="/actions/pages/register_next.jsp" />
          ??????? </action>
          ???????
          ??????? <action?? path="/dyna/register"? type="com.allanlxf.action.RegisterAction"
          ?????????????????? name="userForm">
          ????????? <forward name="success" path="/dyna/success.jsp"/>
          ??????? </action>
          ???????
          ??? </action-mappings>
          ???
          ??? <message-resources parameter="com.allanlxf.MessageResources" />
          ?????????????????
          </struts-config>



          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          <2007年4月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          相冊

          收藏夾

          朋友

          搜索

          •  

          最新評論

          評論排行榜

          主站蜘蛛池模板: 天祝| 汪清县| 满城县| 和林格尔县| 黄陵县| 绥化市| 独山县| 游戏| 台南市| 浑源县| 乌拉特前旗| 三亚市| 靖西县| 宁津县| 竹山县| 莱州市| 永定县| 沧源| 盐亭县| 东阿县| 杭锦旗| 图木舒克市| 云南省| 靖宇县| 凉山| 盈江县| 临安市| 铜川市| 新沂市| 资兴市| 平顺县| 瑞金市| 米易县| 定边县| 奈曼旗| 额济纳旗| 松滋市| 沅陵县| 玉溪市| 彭山县| 大姚县|