Use to create a new action.
An action responds to a request. Writing an action means subclassing one of the Action classes and then overriding the class's execute
method. An ActionForward is returned by the execute
method.
Before you can use the New Struts Action wizard, you must have a Struts configuration file. To create a Struts configuration file quickly and efficiently, right-click the project node, choose Properties and use the Frameworks panel. Not only does this provide you with a Struts configuration file, but you also get the Struts libraries and supporting files.
Once you have a Struts configuration file, you open the New Struts Action wizard by right-clicking a web application, choosing New > Other and selecting Struts Action from the Struts category.
In the Name and Location page, you set the following properties:
Element | Description |
---|---|
Class Name |
Specifies the action's class name. |
Project |
Specifies the project of the new action class. |
Location |
Specifies a folder to house the action. |
Package |
Specifies a package within the location to house the action. |
Created File |
Specifies the file that will be created for the new action class. |
Superclass |
Specifies the class on which the action is based. This can be one of the following: |
|
An Action is an adapter between the contents of an incoming HTTP request and the corresponding business logic that should be executed to process this request. The controller ( |
|
An abstract Action that dispatches to a public method that is named by the request parameter whose name is specified by the |
|
An abstract |
|
An abstract Action that dispatches to the subclass-mapped |
Configuration File |
Specifies the Struts configuration file, |
Action Path |
Associates the action with an incoming path. For example, if you type |
If you click Next, you can let the IDE associate an existing actionform bean with the action. If you click Finish, the action is created on your computer and opened in the IDE.
Related Topics
Developing Applications with NetBeans IDE,
Developing Applications with NetBeans IDE,
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |