Skip to content

Commit a083a73

Browse files
Update README.md
1 parent c29ab3a commit a083a73

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,35 @@ You have downloaded a zip file with the binary distribution of Tomcat. Unzip the
5151
### Build the project
5252
First we need to select all artifacts that will be used to create the .war file that will be deployed to the Tomcat server.
5353

54-
1. Within the IntelliJ IDE, right click on the root of the project in the "Project" view on the left side of the editor
54+
1. Within the IntelliJ IDE, right click on the root of the project in the "Project" tool window on the left side of the editor
5555
2. Select "Open Module Settings"
5656
3. Select "Artifacts" from the left panel
5757
4. Select the "+" on top of the center panel
5858
5. Select the "Web Application: Archive" and select the option for our project
5959
6. Make sure that the "Include in project build" checkbox for our archive is selected
6060
7. Click "Apply" and "Done"
61+
62+
### Create new servlet
63+
64+
## Create servlet class file
65+
1. Navigate to the `src` folder in the "Project" tool window
66+
2. Right click on the `src` folder
67+
3. Select "New" -> "Servlet"
68+
69+
## Add the servlet definition and mapping to the web.xml
70+
1. Navigate to `web.xml`
71+
2. Insert the servlet definition and mapping inside the `web-app` tags
72+
73+
**Example:**
74+
```xml
75+
<servlet>
76+
<servlet-name>ServletName</servlet-name>
77+
<servlet-class>ServletName</servlet-class>
78+
</servlet>
79+
80+
<servlet-mapping>
81+
<servlet-name>ServletName</servlet-name>
82+
<url-pattern>/ServletName</url-pattern>
83+
</servlet-mapping>
84+
```
85+

0 commit comments

Comments
 (0)