When using the Jakarta Servlet in Eclipse 2022 -12, the JSP file will have errors [message #1856696] |
Fri, 23 December 2022 08:49 |
panda mkk Messages: 38 Registered: April 2022 |
Member |
|
|
When I use Eclipse 2022-12 to import a web project using jakarta. servlet
Errors will occur in all jsp files
like this:
HttpServletRequest cannot be resolved to a type
javax.servlet cannot be resolved to a type
The superclass "javax.servlet.http.HttpServlet", determined from the Dynamic Web Module facet version (2.5), was not found on the Java Build Path
Although there are errors, it can still be started and run normally with tomcat
It seems that the problem from javax ->Jakarta
But for the same project, I did not have any errors in Eclipse 2022-03
Does anyone have the same problem?
Is this an Eclipse validation problem or is there something wrong with my project?
This is my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
......
......
</web-app>
This is the jakarta servlet api I use
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.servlet.jsp</groupId>
<artifactId>jakarta.servlet.jsp-api</artifactId>
</dependency>
<!-- Required only for Tomcat. If run on other J2EE server,
remove this dependency and use provided tag libraries. -->
<dependency>
<groupId>jakarta.servlet.jsp.jstl</groupId>
<artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
<scope>runtime</scope>
</dependency>
[Updated on: Fri, 23 December 2022 08:50] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04418 seconds