Considerations and differences for deploying projects in the Tomcat jetty container

Source: Internet
Author: User
        <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&gt
            ; </exclusions> </dependency> <dependency> <groupid>javax.servlet</gr Oupid> <artifactId>javax.servlet-api</artifactId> <version>${servlet.version} </version> <!--scope>provided</scope--> </dependency> &LT;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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.