When writing the project, the servlet has been unable to work normally. After consulting the data for many times, we found the following possibilities.
First, automatic editing is not turned on
In the top project option, check build automatically from the drop-down list
Second: the version of the top header in web.xml is too low
The author uses @ webservlet (urlpatterns =/xxservlet) mode, which does not need to configure servlet file in web.xml, but only version 3.0 or above supports this mode. Therefore, in web.xml, there must be version = 3.1.
You can directly copy the following code to use.
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"> <display-name>Project Name</display-name> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
Third: Tomcat configuration problems
Remove Tomcat from the server and install Tomcat again according to the process.
1. Delete Tomcat
2. Select preference in the top window option. In the pop-up box, select server — runtime environment — and select the original Tomcat — remove
3. Then click Add to configure the Tomcat you downloaded.
I hope eclipse will work properly.
- Spring MVC uses Ajax to submit requests asynchronously to complete login
- Maven (http://repo1.maven.org/maven2/): Failed to transfer file and PKIX path building failed: sun.secu
- [Solved] Failed to bind properties under ‘spring.servlet.multipart.file-size-threshold‘ to
- Maven project running servlet jump JSP error: HTTP status 500 – unable to compile class for JSP
- [How to Fix]Spring 3.0 could not find acceptable representation
- [How to Solve Error]java.util.Date cannot be cast to java.sql.Date
- Notes for migrating Oracle jdk8 to openjdk11
- Monitoring session to determine whether the user is online or not
- The thread implementation of timer in Java
- springboot jsp: There was an unexpected error (type=Not Found, status=404). No message available
- Resolve warning: could’t clear Tomcat cache java.lang.NoSuchFieldException: resourceEntries
- org.hibernate.exception.SQLGrammarException: could not extract ResultSet, Resolve MySQL 5.7.5 or above GROUP_BY is not supported
- JAVA Error Illegal access: this web application instance has been stopped already. Could not load net.sf
- Error in make when installing redis6.0 in centos7
- [Solved] IO exception: NL exception was generated
- Eclipse Error: There are no resources that can be added or removed from the server.
- [Solved] Java.lang.ClassNotFoundException: org.apache.commons.fileupload.FileItemFactory
- When the database table field is set to self incrementing, use the entity class to insert or update the data to solve the error (Hibernate Framework)
- The node requests the API address written by java to report an error error:getaddrinfo ENOTFOUND
- Caused by: java.lang.IllegalStateException (How to Fix)