⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mappingdispatchaction.html

📁 struts api,学习使用struts必备的文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Mar 09 15:31:22 GMT 2006 -->
<TITLE>
Apache Struts API Documentation: Class  MappingDispatchAction
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/MappingDispatchAction.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/struts/actions/LookupDispatchAction.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/struts/actions/RedeployableActionServlet.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MappingDispatchAction.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.struts.actions</FONT>
<BR>
Class  MappingDispatchAction</H2>
<PRE>
java.lang.Object
  |
  +--<A HREF="../../../../org/apache/struts/action/Action.html">org.apache.struts.action.Action</A>
        |
        +--<A HREF="../../../../org/apache/struts/actions/DispatchAction.html">org.apache.struts.actions.DispatchAction</A>
              |
              +--<B>org.apache.struts.actions.MappingDispatchAction</B>
</PRE>
<HR>
<DL>
<DT>public class <B>MappingDispatchAction</B><DT>extends <A HREF="../../../../org/apache/struts/actions/DispatchAction.html">DispatchAction</A></DL>

<P>
<p>An abstract <strong>Action</strong> that dispatches to a public method that is named by the <code>parameter</code> attribute of  the corresponding ActionMapping.  This is useful for developers who prefer to combine many related actions into a single Action class.</p> <p>To configure the use of this action in your <code>struts-config.xml</code> file, create an entry like this:</p> <pre><code>   &lt;action path="/saveSubscription"           type="org.example.SubscriptionAction"           name="subscriptionForm"          scope="request"          input="/subscription.jsp"      parameter="method"/&gt; </code></pre> <p>where 'method' is the name of a method in your subclass of MappingDispatchAction that has the same signature (other than method name) of the standard Action.execute method.  For example, you might combine the methods for managing a subscription into a  single  MappingDispatchAction class using the following methods:</p>  <ul> <li>public ActionForward create(ActionMapping mapping, ActionForm form,     HttpServletRequest request, HttpServletResponse response)     throws Exception</li> <li>public ActionForward edit(ActionMapping mapping, ActionForm form,     HttpServletRequest request, HttpServletResponse response)     throws Exception</li> <li>public ActionForward save(ActionMapping mapping, ActionForm form,     HttpServletRequest request, HttpServletResponse response)     throws Exception</li> <li>public ActionForward delete(ActionMapping mapping, ActionForm form,     HttpServletRequest request, HttpServletResponse response)     throws Exception</li> <li>public ActionForward list(ActionMapping mapping, ActionForm form,     HttpServletRequest request, HttpServletResponse response)     throws Exception</li> </ul> <p>for which you would create corresponding &lt;action&gt; configurations  that reference this class:</p> <pre><code>  &lt;action path="/createSubscription"           type="org.example.SubscriptionAction"          parameter="create"&gt;      &lt;forward name="success" path="/editSubscription.jsp"/&gt;  &lt;/action&gt;   &lt;action path="/editSubscription"           type="org.example.SubscriptionAction"          parameter="edit"&gt;      &lt;forward name="success" path="/editSubscription.jsp"/&gt;  &lt;/action&gt;  &lt;action path="/saveSubscription"           type="org.example.SubscriptionAction"           parameter="save"          name="subscriptionForm"           validate="true"           input="/editSubscription.jsp"           scope="request"&gt;      &lt;forward name="success" path="/savedSubscription.jsp"/&gt;  &lt;/action&gt;  &lt;action path="/deleteSubscription"           type="org.example.SubscriptionAction"          name="subscriptionForm"          scope="request"          input="/subscription.jsp"          parameter="delete"&gt;      &lt;forward name="success" path="/deletedSubscription.jsp"/&gt;  &lt;/action&gt;  &lt;action path="/listSubscriptions"           type="org.example.SubscriptionAction"          parameter="list"&gt;      &lt;forward name="success" path="/subscriptionList.jsp"/&gt;  &lt;/action&gt; </code></pre> <p><strong>NOTE</strong> - Unlike DispatchAction, mapping characteristics  may differ between the various handlers, so you can combine actions in the  same class that, for example, differ in their use of forms or validation.  Also, a request parameter, which would be visible to the application user, is not required to enable selection of the handler method.  </p>
<P>
<DL>
<DT><B>Since: </B><DD>Struts 1.2</DD>
<DT><B>Version: </B><DD>$Rev: 54929 $ $Date: 2004-10-16 17:38:42 +0100 (Sat, 16 Oct 2004) $</DD>
</DL>
<HR>

<P>
<!-- ======== INNER CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private static&nbsp;org.apache.commons.logging.Log</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/struts/actions/MappingDispatchAction.html#log">log</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Commons Logging instance.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="fields_inherited_from_class_org.apache.struts.actions.DispatchAction"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Fields inherited from class org.apache.struts.actions.<A HREF="../../../../org/apache/struts/actions/DispatchAction.html">DispatchAction</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../org/apache/struts/actions/DispatchAction.html#clazz">clazz</A>, <A HREF="../../../../org/apache/struts/actions/DispatchAction.html#messages">messages</A>, <A HREF="../../../../org/apache/struts/actions/DispatchAction.html#methods">methods</A>, <A HREF="../../../../org/apache/struts/actions/DispatchAction.html#types">types</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="fields_inherited_from_class_org.apache.struts.action.Action"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Fields inherited from class org.apache.struts.action.<A HREF="../../../../org/apache/struts/action/Action.html">Action</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../org/apache/struts/action/Action.html#defaultLocale">defaultLocale</A>, <A HREF="../../../../org/apache/struts/action/Action.html#servlet">servlet</A>, <A HREF="../../../../org/apache/struts/action/Action.html#token">token</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/struts/actions/MappingDispatchAction.html#MappingDispatchAction()">MappingDispatchAction</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -