Tomcat服务器
1.服务器概念:
服务器是一个容器,可以将任何资源放到服务器中,服务器启动后
外部用户可以通过 ip地址:端口/资源路径 来访问服务器容器内对应的资源
你可以将服务器理解为一个资源共享容器
2.在idea中部署tomcat服务器
maven依赖:
<packaging>war</packaging><properties><maven.compiler.source>8</maven.compiler.source><maven.compiler.target>8</maven.compiler.target><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties><dependencies><dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>5.1.6.RELEASE</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-webmvc</artifactId><version>5.1.6.RELEASE</version></dependency><dependency><groupId>javax.servlet</groupId><artifactId>javax.servlet-api</artifactId><version>4.0.0-b01</version><scope>provided</scope></dependency><dependency><groupId>javax.servlet.jsp</groupId><artifactId>jsp-api</artifactId><version>2.2.1-b03</version><scope>provided</scope></dependency></dependencies><build><plugins><!--tomcat插件--><plugin><groupId>org.apache.tomcat.maven</groupId><!-- tomcat7的插件, 不同tomcat版本这个也不一样 --><artifactId>tomcat7-maven-plugin</artifactId><version>2.1</version><configuration><!-- 通过maven tomcat7:run运行项目时,访问项目的端口号 --><port>8989</port><!-- 项目访问路径 本例:localhost:9090, 如果配置的aa, 则访问路径为localhost:9090/aa--><path>/springmvcdemo</path></configuration></plugin></plugins></build>
tomcat服务器容器设置
(7条消息) tomcat服务器容器目录资源-CSDN文库https://download.csdn.net/download/qq_46335546/87709831