<dependency> <groupId>javax.servlet.jsp</groupId> <artifactid>jsp- Api</artifactid> <version>${jsp.version}</version> <!--scope>provided</ scope--> <exclusions> <exclusion> <artifactid>servlet -api</artifactid> <groupId>javax.servlet</groupId> </exclusion>
; </exclusions> </dependency> <dependency> <groupid>javax.servlet</gr Oupid> <artifactId>javax.servlet-api</artifactId> <version>${servlet.version} </version> <!--scope>provided</scope--> </dependency> <DEPENDENCY&G
T <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>${jstl.version}</version> <!--scope>provided</scope--> </dependency>
Running in the Jetty container requires opening provided because the jetty container already has its own implementation of SERVLET,JSTL and JSP. However, when the project needs to be deployed into Tomcat, because the Tomcat container is not implemented with SERVLET,JSTL and JSP implementations, the provided needs to be closed and the corresponding package will be placed.
In the jetty environment, if Jetty does not set the basic context of the project, the corresponding ${ctx}, that is, the context path cannot find the corresponding project path, the configuration jetty project needs to be configured with the corresponding context.
<plugin> <groupId>org.eclipse.jetty</groupId> <artifactid>jetty-maven-plug In</artifactid> <version>9.1.6.v20160112</version> <configura Tion> <stopPort>9966</stopPort> <stopkey>stop-jetty-f Or-it</stopkey> <webAppConfig> <contextpath>/${proje Ct.build.finalname}</contextpath> </webAppConfig> </configurati
on> <!--dependencies> <dependency>
<groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId>
<version>5.1.38</version> </dependency> </dependenciEs--> </plugin>
Later versions of Mysql-connector-java are dependent on jetty when configured to jetty, but Tomcat does not require a similar operation.