New Struts ActionForm Bean Wizard: Name and Location
See Also
An actionform bean acts as a bridge between a JSP page and a Struts action.
It captures user input from the JSP pages and delivers it to the action.
An actionform bean can also validate the input before passing it on to the action.
The New Struts ActionForm Bean wizard creates a new actionform bean. Before you can use the
New Struts ActionForm Bean 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 congfiguration file, you open the New Struts ActionForm Bean wizard by right-clicking a web application,
choosing New > File/Folder and selecting Struts ActionForm Bean from the Web category.
In the Name and Location page, you set the following properties:
- Class Name. Specifies the actionform bean's class name.
- Location. Specifies a folder to house the actionform bean.
- Package. Specifies a package within the location to house the actionform bean.
- Superclass. Specifies the class on which the actionform bean is based. A normal actionform bean is based
on either the org.apache.struts.action.ActionForm or org.apache.struts.action.DynaActionForm classes for statically defined or
dynamic form beans respectively. If you want to validate the input to an actionform bean using a validator,
you have to use one of the following superclasses instead:
- For static (coded) beans
- org.apache.struts.validator.ValidatorForm
- org.apache.struts.validator.ValidatorActionForm
- For dynamic (declarative) beans
- org.apache.struts.validator.DynaValidatorForm
- org.apache.struts.validator.DynaValidatorActionForm
- Configuration File. Specifies the Struts configuration file, the struts-config.xml file. If none exists,
you cannot create the actionform bean. 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.
After you complete the wizard, you can use the following dialog boxes to add entries in struts-config.xml:
- See Also
- About Web Application Frameworks
- Creating a New Application with Struts Support
- Adding Struts Support to an Existing Application
Legal Notices