File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,10 +51,35 @@ You have downloaded a zip file with the binary distribution of Tomcat. Unzip the
5151### Build the project
5252First 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
55552 . Select "Open Module Settings"
56563 . Select "Artifacts" from the left panel
57574 . Select the "+" on top of the center panel
58585 . Select the "Web Application: Archive" and select the option for our project
59596 . Make sure that the "Include in project build" checkbox for our archive is selected
60607 . 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+
You can’t perform that action at this time.
0 commit comments