My final step is to write the Action class.
最后一步是编写action类。
The Action class will handle all HTTP requests.
action类将处理所有HTTP请求。
Note: "Think thin" when extending the Action class.
注:扩展Action类时请注意简洁。
Listing 3 shows how Action class handles exceptions.
清单3展示了action类是如何处理异常的。
Form action class contains behavior for form actions.
表单操作类包含表单操作的行为。
The action class receives control from the input page.
这个操作类接管输入页面的控制权。
Extend the Struts action class to handle the HTTP request.
扩展Struts动作类以处理HTTP请求。
The remaining Action class implementations are very similar.
其余的操作类实现很相似。
Registering the new action class with the Struts configuration
使用Struts配置注册新的action类
The Action class has the list variables named state and status.
action类具有列表变量,名为state和status。
Generally, each Action class provides a very specific unit of work.
通常,每个Action类都提供了非常具体的工作单元。
A simple Action class to go from the form page to the display page.
一个简单的action类,从表单页面转到显示页面。
The domain model is populated appropriately inside the action class.
操作类中的域模型将被适当填充。
Listing 5. struts-config.xml snippet showing action class path mapping.
清单5 .struts - config . xml代码片段显示了动作类路径映射。
Determines what Action class the Controller calls. The struts-config.xml.
struts - config . xml确定Controller调用哪个action类。
Each Action class implements the execute method of the Struts Action class.
每个action类都将实现Struts action类的execute方法。
Another way of thinking about Action class is as the Adapter design pattern.
考虑action类的另一种方式是Adapter设计模式。
This object is passed back to the action class from where it was called.
这个对象从它被调用的地方传回到action类。
The Action class should control the flow and not the logic of the application.
action类应该控制应用程序的流程,而不应该控制应用程序的逻辑。
This page allows you to name — and will subsequently create — an Action class.
此页面允许您命名并随后创建action类。
Write the Action class to display the data onto the UI, as shown in Listing 1.
编写action类使数据在UI中显示,如清单1所示。
Data is added in the Action class by making state and status of type arraylist.
通过将state和status设置为arraylist类型将数据添加到action类。
Modify the Action class and add code for the default value, as shown in Listing 4.
修改action类,并添加默认值的代码,如清单4所示。
The name of the list variables in JSP must match the name given in the Action class.
JS p中的列表变量必须匹配action类中的名称。
When a Struts action takes place, its action class passes data to the property broker.
当一个Struts行为发生以后,它的行为类就会将数据传递给这个属性代理。
First, it helps you avoid redundant code in every Action class of your Web application.
首先,它避免了Web应用程序中每个action类的冗余代码。
Create an action class, say BP4Action, by extending org.apache.struts.action.Action.
通过扩展org . apache . struts .action . action创建一个action类,比如BP 4action。
The corresponding Action class may determine the order in which these methods are called.
相应的action类可以决定这些方法的调用顺序。
The new action class that you created needs to be registered with the Struts configuration.
您创建的新action类需要注册到Struts配置。
You've now created an action class that is the entry point when a property change has occurred.
现在,您已经创建了发生属性更改时作为入口点的操作类。
应用推荐