ActionSource2 (Java EE 5)

Java EE API


javax.faces.component Interface ActionSource2

All Superinterfaces:
ActionSource
All Known Implementing Classes:
HtmlCommandButton, HtmlCommandLink, UICommand

public interface ActionSource2
extends ActionSource

Implements: ActionSource
Implemented by: UICommand

ActionSource2 扩展 ActionSource,并提供与 ActionSource 上的 "action" 属性类似的 JavaBeans 属性。不同之处在于,此属性的类型是 MethodExpression 而不是 MethodBinding。这就允许 ActionSource 概念利用新的统一 EL API。

英文文档:

ActionSource2 extends ActionSource and provides a JavaBeans property analogous to the "action" property on ActionSource. The difference is the type of this property is a MethodExpression rather than a MethodBinding. This allows the ActionSource concept to leverage the new Unified EL API.

Since:
1.2

Method Summary
 MethodExpression
 void
 
Methods inherited from interface javax.faces.component.ActionSource
 

Method Detail

public MethodExpression getActionExpression()

返回一个 MethodExpression,该 MethodExpression 指向用户激活此 UIComponent 时要在请求处理生命周期的应用请求值调用应用程序 阶段(取决于 immediate 属性的值)调用的应用程序操作。

注意,返回的 MethodExpression 有可能仅是通过调用 ActionSource#setAction 设置的 MethodBinding 实例周围的包装器。这使得默认 ActionListener 有可能继续与旧的组件一起正常工作。

英文文档:

getActionExpression

MethodExpression getActionExpression()

Return the MethodExpression pointing at the application action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.

Note that it's possible that the returned MethodExpression is just a wrapper around a MethodBinding instance whith was set by a call to ActionSource.setAction(javax.faces.el.MethodBinding). This makes it possible for the default ActionListener to continue to work properly with older components.


public void setActionExpression(MethodExpression action)

设置一个 MethodExpression,该 MethodExpression 指向用户激活此 UIComponent 时要在请求处理生命周期的应用请求值调用应用程序 阶段(取决于 immediate 属性的值)调用的应用程序操作。

此表达式所引用的任何方法都必须是公共的,返回类型为 String,并且不接受任何参数。

action 新的方法表达式
英文文档:

setActionExpression

void setActionExpression(MethodExpression action)

Set the MethodExpression pointing at the appication action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.

Any method referenced by such an expression must be public, with a return type of String, and accept no parameters.

Parameters:
action - The new method expression


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!