The first javaWeb project

Create the first web project
Step 1:
Right-click on the project explorer to create a new >>>dynamic web project>>>enter the project name>>>next>>>next>>>check generate web.xml deployment descriptor to create a web .xml configuration file>>>finish, so far the first web project is established.

Step 2:
Select the web project, right click and create a new >>>jsp file, and name it index. jsp. If an error is reported in the jsp project: The superclass javax .servlet.http.HttpServlet was not found on the Java Build Path.
Please see this blog
https ://www.cnblogs.com/achengmu/p/882457.html

Here the first web project is created successfully.
Insert picture description here

To create a tomcat server,
switch to the servers window >>> right-click server >>> apache >>> select the tomcat you installed >>> finish.
Insert picture description here
To let the tomcat server load the web project,
switch to the servers window >>> click the tomcat server >>> right click add and remove >>> put the items under available on the left to the configured on the right. On the contrary, if the items under configured on the right are placed under available on the left, they are not loaded.
Insert picture description hereImport the servlet-api.jar package.
If you follow the steps above to create the project, you don’t need to import this package, because the web project is loaded into the tomcat server, and the tomcat server has related servlet packages, so you don’t need to import the servlet -api and other packages.

Guess you like

Origin blog.csdn.net/weixin_44421869/article/details/103099687