You can create a servlet with the wizard that will guide you through the creation of the component. The wizard is invoked from a class diagram. It is only available if the language is Java.
You can either create a servlet without selecting any class, or select a class beforehand and start the wizard from the contextual menu of the class.
You can also create several servlets of the same type by selecting several classes at the same time. The wizard will automatically create one servlet per class. The classes you have selected in the class diagram become servlet classes. They are renamed to fit the naming conventions standard, and they are linked to the new servlet component.
The wizard for creation of a servlet lets you define the following parameters:
Wizard page |
Description |
---|---|
Name |
Name of the servlet component |
Code |
Code of the servlet component |
Servlet type |
You can select the following types: HttpServlet that supports the http protocol (most commonly used), GenericServlet that extends the servlet generic class, or user-defined that implies some customization as it does not implement anything |
Servlet class |
Class that provides the Servlet implementation. |
Create symbol |
Creates a component symbol in the diagram specified beside the Create symbol In check box. If a component diagram already exists, you can select one from the list. You can also display the diagram properties by selecting the Properties tool |
Create Class Diagram for component classifiers |
Creates a class diagram with a symbol for each class. If you have selected classes before starting the wizard, they are used to create the component. This option allows you to display these classes in a diagram |
When you have finished using the wizard, the following actions are executed:
A servlet component is created
The servlet class is created and visible in the Browser. It is named after the original class if you have selected a class before starting the wizard
If you have not selected a class beforehand, it is prefixed after the original default component name to preserve coherence
Any diagrams associated with the component are created or updated