- 浏览: 49899 次
- 性别:
- 来自: **
最新评论
-
youanyyou:
不错 有IT人员的风范
中国网站前途预测 -
wanggod:
我用一个,呵呵,
腾讯微博邀请,要的自取。 -
zyengogo:
我没拿到
( ⊙ o ⊙ )啊!
腾讯微博邀请,要的自取。 -
hilly:
mercyblitz 写道可以换一个端口试试 估计是他软件缺陷 ...
Ashampoo不厚道,和tomcat冲突?! -
mercyblitz:
可以换一个端口试试
Ashampoo不厚道,和tomcat冲突?!
<!-- -->
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES <!-- if(window==top) { document.writeln('<a target="_blank" rel="nofollow" HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //-->All ClassesAll Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
<!-- ======== START OF CLASS DATA ======== -->
org.apache.struts.actions
<script type="text/javascript">
<!--
google_ad_client = "pub-0139896083561460";
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = "336x280_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "870100";
google_color_bg = "FFFFFF";
google_color_link = "0033FF";
google_color_url = "999999";
google_color_text = "FF0099";
//-->
</script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
</script>
Class LookupDispatchAction
<script type="text/javascript"> <!-- google_ad_client = "pub-0139896083561460"; google_ad_width = 336; google_ad_height = 280; google_ad_format = "336x280_as"; google_ad_type = "text"; google_ad_channel =""; google_color_border = "870100"; google_color_bg = "FFFFFF"; google_color_link = "0033FF"; google_color_url = "999999"; google_color_text = "FF0099"; //--> </script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"> </script>
java.lang.Object org.apache.struts.action.Actionorg.apache.struts.actions.DispatchActionorg.apache.struts.actions.LookupDispatchAction
<script type="text/javascript"><!-- google_ad_client = "pub-0139896083561460"; google_ad_width = 336; google_ad_height = 280; google_ad_format = "336x280_as"; google_ad_type = "text"; google_ad_channel =""; google_color_border = "870100"; google_color_bg = "FFFFFF"; google_color_link = "0033FF"; google_color_url = "999999"; google_color_text = "FF0099"; //--></script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
An abstract Action that dispatches to the subclass mapped
execute
method. This is useful in cases where an HTML form has multiple submit buttons with the same name. The button name is specified by the parameter
property of the corresponding ActionMapping. To configure the use of this action in your struts-config.xml
file, create an entry like this:
<action path="/test"
type="org.example.MyAction"
name="MyForm"
scope="request"
input="/test.jsp"
parameter="method"/>
which will use the value of the request parameter named "method" to locate the corresponding key in ApplicationResources. For example, you might have the following ApplicationResources.properties:
button.add=Add Record button.delete=Delete Record
And your JSP would have the following format for submit buttons:
<html:form action="/test">
<html:submit property="method">
<bean:message key="button.add"/>
</html:submit>
<html:submit property="method">
<bean:message key="button.delete"/>
</html:submit> </html:form>
Your subclass must implement both getKeyMethodMap and the methods defined in the map. An example of such implementations are:
protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put("button.add", "add");
map.put("button.delete", "delete");
return map;
}
public ActionForward add(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
// do add
return mapping.findForward("success");
}
public ActionForward delete(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
// do delete
return mapping.findForward("success");
}Notes - If duplicate values exist for the keys returned by getKeys,
only the first one found will be returned. If no corresponding key is found
then an exception will be thrown. You can override the methodunspecified
to
provide a custom handler. If the submit was cancelled (ahtml:cancel
button
was pressed), the custom handlercancelled
will be used instead.<!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- -->
Field Summary | |
protected java.util.Map |
keyMethodMap Resource key to method name lookup. |
protected java.util.Map |
localeMap Reverse lookup map from resource value to resource key. |
Fields inherited from class org.apache.struts.actions.DispatchAction |
clazz, log, messages, methods, types |
Fields inherited from class org.apache.struts.action.Action |
defaultLocale, servlet |
Constructor Summary |
LookupDispatchAction() |
Method Summary | |
ActionForward |
execute(ActionMapping mapping, ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Process the specified HTTP request, and create the corresponding HTTP response (or forward to another web component that will create it). |
protected abstract java.util.Map |
getKeyMethodMap() Provides the mapping from resource key to method name. |
protected java.lang.String |
getLookupMapName(javax.servlet.http.HttpServletRequest request, java.lang.String keyName, ActionMapping mapping) Lookup the method name corresponding to the client request's locale. |
protected java.lang.String |
getMethodName(ActionMapping mapping, ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String parameter) Returns the method name, given a parameter's value. |
private java.util.Map |
initLookupMap(javax.servlet.http.HttpServletRequest request, java.util.Locale userLocale) This is the first time this Locale is used so build the reverse lookup Map. |
Methods inherited from class org.apache.struts.actions.DispatchAction |
cancelled, dispatchMethod, getMethod, unspecified |
Methods inherited from class org.apache.struts.action.Action |
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
<!-- ============ FIELD DETAIL =========== --><!-- -->
Field Detail |
localeMap
protected java.util.Map localeMap
<!-- -->
keyMethodMap
protected java.util.Map keyMethodMap
Constructor Detail |
LookupDispatchAction
public LookupDispatchAction()<!-- ============ METHOD DETAIL ========== --><!-- -->
Method Detail |
execute
public ActionForwardexecute(ActionMapping mapping,
ActionForm form,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.lang.Exception
response (or forward to another web component that will create it).
Return an
ActionForward
instance describing where and how control should be forwarded, or
null
if the response has already been completed.execute
in class DispatchAction
mapping
- The ActionMapping used to select this instancerequest
- The HTTP request we are processingresponse
- The HTTP response we are creatingform
- The optional ActionForm bean for this request (if any)java.lang.Exception
- if an error occurs<!-- -->
initLookupMap
private java.util.Map initLookupMap(
javax.servlet.http.HttpServletRequest request,
java.util.Locale userLocale)
Search for message keys in all configured MessageResources for the current
module.
<!-- -->
getKeyMethodMap
protected abstract java.util.Map getKeyMethodMap()
<!-- -->
getLookupMapName
protected java.lang.String getLookupMapName(
javax.servlet.http.HttpServletRequest request,
java.lang.String keyName,
ActionMapping mapping)
throws javax.servlet.ServletException
request
- The HTTP request we are processingkeyName
- The parameter name to use as the properties keymapping
- The ActionMapping used to select this instancejavax.servlet.ServletException
- if keyName cannot be resolved<!-- -->
getMethodName
protected java.lang.String getMethodName(ActionMapping mapping,
ActionForm form,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String parameter)
throws java.lang.Exception
getMethodName
in class DispatchAction
mapping
- The ActionMapping used to select this instanceform
- The optional ActionForm bean for this request (if any)request
- The HTTP request we are processingresponse
- The HTTP response we are creatingparameter
- The ActionMapping
parameter's namejava.lang.Exception
<!-- ======= START OF BOTTOM NAVBAR ====== --><!-- -->
<!-- -->
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES <!-- if(window==top) { document.writeln('<a target="_blank" rel="nofollow" HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //-->All ClassesAll Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2000-2004 - The Apache Software Foundation
<!-- Body End --><script language="javascript" src="bodyend.js"></script><script src="http://www.google-analytics.com/urchin.js" defer type="text/javascript"></script><script defer type="text/javascript"><![CDATA[uacct = "UA-469010-2";urchinTracker();]]></script>
发表评论
-
集成新版本Tomcat到JBuilder
2006-06-29 20:14 558Overview <!-- Enter Approp ... -
什么是ERP软件
2006-07-04 07:16 707什么是ERP软件? ERP是英文Enterprise R ... -
Struts常见错误汇总(转)
2006-07-06 15:49 596以下所说的struts-config.xml和Applicat ... -
JSTL语法及参数
2006-07-13 23:46 1451JSTL语法及参数 JS ... -
struts标签之浅入深出(转)
2006-07-18 12:50 672Action和jsp的开发其实就是对Struts标签的运用.掌 ... -
标签示例
2006-07-18 13:18 646//web.xml <?xml ver ... -
[Struts]应用Map作为ActionForm的属性,动态增加ActionForm的“属性” (转)
2006-07-20 17:17 881[Struts]应用Map作为ActionForm的 ... -
struts的七点经验-1(转)
2006-07-20 17:20 6271. 只在必要的时候 ... -
struts七点经验-2(转)
2006-07-20 17:25 7103. 使用应用模块(Application Modu ... -
struts的七点经验-3(转)
2006-07-20 17:27 7325. 使用 Prebuilt Action类提 ... -
LookupDispatchAction使用示例
2006-07-20 18:01 651LookupDispatchAction ... -
LookupDispatchAction使用示例(中文)(转)
2006-07-20 18:04 741org.apache.struts.actions.Looku ... -
什么是数据仓库(转)
2006-07-24 14:01 678什么是数据仓库 (转载自北大高科网站,ht ... -
jsp生成随机验证码图片(转)
2006-08-06 21:45 887转自:http://www.matrix.org.cn/res ... -
Struts安装配置(转)
2006-08-16 17:11 862Struts安装配置 1、Struts的安 ... -
Struts入门(转)
2006-08-16 17:39 624Struts安装: 首先请到http://jakarta.ap ... -
J2EE建议的学习路线
2006-08-16 17:44 774J2EE建议的学习路线 来 ... -
java 中的内存泄漏
2006-09-07 19:49 588出自:ibm:developerworks中 ... -
为什么要使用EJB
2006-09-07 20:04 753为什么要使用EJB? 来源:http://www.jdon ... -
Java 应用程序 安装程序 制作工具 InstallAnywhere (转)
2007-01-08 10:56 1031本文转自:http://www.tongyi.net/deve ...
相关推荐
public class LookupDispatchAction extends DispatchAction { public ActionForward method1(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ...
### DispatchAction、LookupDispatchAction、SwitchAction 的应用详解 #### 一、DispatchAction 的应用 **DispatchAction** 是 Struts 框架中一个非常有用的类,它位于 `org.apache.struts.actions` 包中。其核心...
在Struts框架中,`List_Map_LookupDispatchAction_Validate`涉及了几个关键概念,我们将逐一详细解释。 1. **LookupDispatchAction**: 这是Struts1中的一个特殊类型的动作,主要用于处理多个请求映射到同一个Action...
public class LookupDispatchAction extends DispatchAction { public ActionForward _add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ...
- **LookupDispatchAction**:用于查找和分发请求。 - **SwitchAction**:基于条件进行分发。 ##### 4.ActionForward类 表示Action执行后需要转向的目标页面或资源。 ##### 5.ActionForm类 封装了用户表单数据,...
public class LoginRegisterAction extends LookupDispatchAction { private String button; public String getButton() { return button; } public void setButton(String button) { this.button = button;...
LookupDispatchAction 与`DispatchAction`类似,但提供了更灵活的请求参数到方法映射方式,通常用于基于选择项的分发。 #### 5. ActionMapping 封装了请求到Action的映射信息,包括Action类、ActionForm、结果页面...
Struts LookupDispatchAction 类是Apache Struts 框架中的一种高级控制器,它扩展了`DispatchAction`类,提供了一种更加灵活的方式来处理请求映射。在 Struts 框架中,Action 是业务逻辑的核心组件,负责接收HTTP...
因此,在对本系统进行架构设计的时候,考虑建立一个抽象的BaseAction类,该类继承LookupDispatchAction,实现LookupDispatchAction类中的getKeyMethodMap方法,在方法中返回本系统中请求参数值与资源文件中参数值的...
JavaEE框架 Struts_In_Action(中文版) Struts Action Struts_In_Action LookupDispatchAction DispatchAction 对Action讲的比较仔细,可以深入的了解Struts框架里的基本原理。
Struts 2.0还提供了一种方式来改变默认调用的方法,这类似于Struts 1.x的`LookupDispatchAction`。在`struts.xml`中,可以直接指定Action的执行方法,例如: ```xml <action name="HelloWorld" class="tutorial....
struts1学习资料:里面包含struts源码工程 ActionServlet DispatchAction Action LookUpDispatchAction的用法 还包含html logic bean tiles标签的详细使用方法和validate验证框架的具体案例
在 Struts1 中,使用 LookupDispatchAction 动作可以处理含有多个 submit 的 form。但是,这种方式需要访问属性文件,还需要映射,比较麻烦。从 Struts1.2.9 开始,加入了 EventDispatchAction 动作,该类可以通过 ...
1. **LookupDispatchAction**: 这个文件可能涉及到Struts框架中的`LookupDispatchAction`,这是一个用于处理多视图的Action,它可以根据用户请求的参数来决定调用哪个业务方法。这在实现复杂的视图跳转和逻辑控制时...
在处理一个表单(form)中存在多个submit按钮的情况时,Struts2提供了一种优雅的方式来区分用户点击了哪个按钮,而无需像Struts1那样使用额外的动作类(如LookupDispatchAction或EventDispatchAction)。 在传统的...
- **LookUpDispatchAction**:与 DispatchAction 类似,但更灵活,可以动态地确定方法名。 2. **ActionServlet**:Struts1.x 的核心组件,负责初始化框架、接收 HTTP 请求并将请求分发给相应的 Action 类处理。 3. ...
在这个例子中,可能会使用`LookupDispatchAction`,这是一个特殊类型的Action,它允许根据用户提交的按钮值(submit标签的name属性)来调用不同的业务方法。 在用户界面设计中,静态验证是先于服务器端验证的一步,...
与`LookupDispatchAction`相比,它的使用更为便捷,无需与属性文件关联,也不需要手动在`getKeyMethodMap`方法中进行key和Action方法的映射。 #### 三、EventDispatchAction的工作原理 `EventDispatchAction`通过`...
`DispatchAction`和`LookupDispatchAction`是Struts中的特殊动作,前者允许基于请求参数来调用不同的方法,后者则是在`DispatchAction`基础上进一步细化,根据请求的参数值查找并执行相应的方法。 `DynaActionForm`...