使用spring内置tomcat的注意事项

编程入门 行业动态 更新时间:2024-10-27 07:21:00

使用spring内置tomcat的<a href=https://www.elefans.com/category/jswz/34/1768820.html style=注意事项"/>

使用spring内置tomcat的注意事项

我们在使用内置tomcat的时候,总是会出现各种问题,总结如下:原因都出现在依赖问题上。
servlet及jsp导致与maven集成的tomcat的servlet及jsp冲突(不过有个疑问:我尝试没加scope使用maven集成的tomcat启动却能成功,而用tomcat7启动却有异常)
其次是JDK版本的问题(共计四处)。
第一处:

第二处:

第三处:

第四处:

<?xml version="1.0" encoding="UTF-8"?><project xmlns=".0.0" xmlns:xsi=""xsi:schemaLocation=".0.0 .0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.lvmanba</groupId><artifactId>springmvcdemo4</artifactId><version>1.0-SNAPSHOT</version><packaging>war</packaging><name>springmvcdemo4 Maven Webapp</name><!-- FIXME change it to the project's website --><url>;/url><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><mavenpiler.source>1.8</mavenpiler.source><mavenpiler.target>1.8</mavenpiler.target></properties><dependencies><dependency><groupId>javax.servlet</groupId><artifactId>javax.servlet-api</artifactId><version>3.1.0</version><!--使用内置tomcat一定要开启serv--><scope>provided</scope></dependency><dependency><groupId>javax.servlet.jsp</groupId><artifactId>jsp-api</artifactId><version>2.2.1-b03</version><!--使用内置tomcat一定要开启serv--><scope>provided</scope></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>5.3.14</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-web</artifactId><version>5.3.14</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-webmvc</artifactId><version>5.3.14</version></dependency><!--json格式3个--><!--<dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-core</artifactId><version>2.13.0</version></dependency><dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-databind</artifactId><version>2.13.0</version></dependency><dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-annotations</artifactId><version>2.13.0</version></dependency>--><!--上传--><dependency><groupId>commons-fileupload</groupId><artifactId>commons-fileupload</artifactId><version>1.4</version></dependency></dependencies><build><plugins><plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><version>2.2</version><configuration><port>8081</port><path>/</path><uriEncoding>UTF-8</uriEncoding></configuration></plugin></plugins></build>
</project>

更多推荐

使用spring内置tomcat的注意事项

本文发布于:2024-02-10 15:53:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1676119.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:注意事项   spring   tomcat

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!