这些操作由操作类执行。
清单1显示了其中一个操作类的代码。
接下来我们将实现操作类。
现在,您已经创建了发生属性更改时作为入口点的操作类。
You've now created an action class that is the entry point when a property change has occurred.
用户更新的HTML输入字段的智能命名消除了操作类中的复杂编码。
Intelligent naming of HTML input fields updated by users negates writing complex code in the action class.
操作类继承的抽象类也已被创建以保存所有的操作类实现所需的共同代码。
An abstract class that our Action classes extend has also been created, to hold common code needed for all our Action class implementations.
这通过LoggingOperations完成,它是log4j附加组件的操作类。
This is done using LoggingOperations, which is an operations class for the log4j add-on.
创建了新的操作类之后,就拥有了逻辑执行切入点,那么下面开始开发执行操作的代码。
Now that you have an entry point into your logic with the new action class you created, you can begin to develop the code that does the work.
除了类的对象实例之外,这样做还可以让您避免构建和操作类的开发、部署和执行成本。
This lets you avoid the development, deployment, and execution costs of building and manipulating classes in addition to the object instances of those classes.
我们的抽象操作类需要改成获取WebSpherePortal维护的User对象。
Our abstract action class will need to change to get the User object that WebSphere Portal maintains.
actionutil类(清单10)包含了我们的插件操作类要调用的一般任务所需要的方法。
The class ActionUtil (Listing 10) contains methods for common tasks invoked from our plugin action classes.
在考虑操作类、bean、表单或支持类的实现细节之前,您应当先考虑应用程序配置文件的实现。
Before considering the implementation details of the action classes, beans, forms, or the supporting classes, you should first think about the implementation of the application configuration files.
需要在操作类中添加属性类型ClientPortfolioDetailsBean及其get方法。
We need to add an attribute type ClientPortfolioDetailsBean in the action class, along with its get method.
在get方法中,如果某个bean的实例没有在当前操作类实例中设置,那么应该从会话返回那个bean。
Inside the get method, a bean should be returned from the session if its instance is not set in the current action class instance.
这避免了在操作类中进行复杂编码(如struts1示例所示),将表单bean转换为相关域模型对象。
This allows avoidance of complex coding in the action class (as shown in the Struts 1 example) for converting the form bean in to the related domain model object.
下一个输入屏幕用于定义操作类、该类所在的包,以及用于创建带有输入和输出参数的操作的所有其他元素。
The next input screen is for defining your action class, which package it is in, and all the other elements to create an action with input and output parameters.
注意,这里适用的逻辑取决于域模型的结构,随着属性的级别和数量增加,操作类中的转换的复杂性也相应增加。
Please note that the logic applied here depends on the structure of the domain model, and as the level and number of attributes increase, the complexity of conversion increases in the action class.
在Struts2中,HTML输入字段名称可以生成为ognl表达式,后者有助于消除操作类中的复杂编码。
In Struts 2, the HTML input field names could be generated as OGNL expressions, which in turn helps eliminate complex coding in the action class.
清单9显示了完整的操作类代码,不只是改变项目描述的片断,这样我们可以学习为第二版插件创建的一些实用方法。
Listing 9 shows the complete action class code, not just the segment that changes the project description, so we can learn about some utility methods created for the second revision of the plugin.
要用Struts构建这个相同的示例应用程序,需要两个操作类用于两个按钮,每个类又需要它自己的一组操作映射。
To build the same example app in Struts you would need two action classes for the two buttons, each requiring its own set of action mappings.
抽象操作类继承了org.apache.struts.action.Action并实现了execute方法。
The abstract action class extends org.apache.struts.action.Action and implements the execute method.
此文件夹中包含一个jar文件(新操作类位于其中)和plugin.xml(其中包含有关插件的信息),如图11 中所示。
This folder contains a jar file containing your new action class, and plugin.xml, which contains information about your plug-in (Figure 11).
JamonOperationsImpl是一个操作类,负责执行实际工作,比如在pom .xml中添加依赖项,或将资源复制到所需的位置。
JamonOperationsImpl is an operations class responsible for doing the actual work, like adding a dependency in the pom.xml or copying resources to the desired location.
Linux经常被称作是类“Unix”操作系统。
UML规范并不要求属性及操作可见性必须显示在类图上,但是它要求为每个属性及操作定义可见性。
The UML specification does not require attributes and operations visibility to be displayed on the class diagram, but it does require that it be defined for each attribute or operation.
这是一个常用的用于异步操作的类。
它是惟一一个执行ejb操作的类,并保存对PhoneBookSession无状态会话bean的引用。
It is the only class where EJB operations are performed, and it holds the reference to the PhoneBookSession stateless session bean.
你可以将日志操作分为以下3类。
这个类提供了操作SDO的合计和辅助方法。
This class provides aggregate and helper methods that operate on the SDO objects.
我们为何仍然需要一个“传统”连接的理由是所有其他JDBC操作和类(Statement、ResultSet…)都基于或使用Connection对象。
The reason why we still need a "traditional" connection is the fact, that all other JDBC operations and classes (Statement, ResultSet,...) are based on or using a connection object.
应用推荐