0
点赞
收藏
分享

微信扫一扫

springboot中使用jetty服务器

迎月兮 2022-11-30 阅读 60


修改pom.xml

1、加入依赖

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jetty</artifactId>
        </dependency>

2、修改依赖

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

3、运行application

springboot中使用jetty服务器_java

4、控制台信息

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.0.RELEASE)

2019-09-18 10:53:56,527 - Starting ThymeleafApplication on WXT-microcomputer with PID 10564 (E:\JSP\springboot\target\classes started by DELL in E:\JSP\springboot)
2019-09-18 10:53:56,543 - No active profile set, falling back to default profiles: default
2019-09-18 10:53:56,652 - Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@394a2528: startup date [Wed Sep 18 10:53:56 CST 2019]; root of context hierarchy
2019-09-18 10:53:58,089 - Logging initialized @2874ms to org.eclipse.jetty.util.log.Slf4jLog
2019-09-18 10:53:58,317 - Server initialized with port: 8081
2019-09-18 10:53:58,317 - jetty-9.4.8.v20171121, build timestamp: 2017-11-22T05:27:37+08:00, git hash: 82b8fb23f757335bb3329d540ce37a2a2615f0a8
2019-09-18 10:53:58,520 - DefaultSessionIdManager workerName=node0
2019-09-18 10:53:58,520 - No SessionScavenger set, using defaults
2019-09-18 10:53:58,535 - Scavenging every 660000ms
2019-09-18 10:53:58,535 - Initializing Spring embedded WebApplicationContext
2019-09-18 10:53:58,535 - Root WebApplicationContext: initialization completed in 1883 ms
2019-09-18 10:53:58,692 - Servlet dispatcherServlet mapped to [/]
2019-09-18 10:53:58,692 - Mapping filter: 'characterEncodingFilter' to: [/*]
2019-09-18 10:53:58,707 - Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2019-09-18 10:53:58,707 - Mapping filter: 'httpPutFormContentFilter' to: [/*]
2019-09-18 10:53:58,707 - Mapping filter: 'requestContextFilter' to: [/*]
2019-09-18 10:53:58,707 - Started o.s.b.w.e.j.JettyEmbeddedWebAppContext@680362a{/study005,[org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory$LoaderHidingResource@3569edd5],AVAILABLE}
2019-09-18 10:53:58,707 - Started @3496ms
2019-09-18 10:53:59,176 - Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@394a2528: startup date [Wed Sep 18 10:53:56 CST 2019]; root of context hierarchy
2019-09-18 10:53:59,265 - Mapped "{[/]}" onto public org.springframework.web.servlet.ModelAndView com.itlaoqi.thymeleaf.controller.ThymeleafController.index()
2019-09-18 10:53:59,280 - Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2019-09-18 10:53:59,280 - Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2019-09-18 10:53:59,327 - Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2019-09-18 10:53:59,327 - Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2019-09-18 10:53:59,390 - Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2019-09-18 10:53:59,499 - Adding welcome page template: index
2019-09-18 10:54:00,077 - Registering beans for JMX exposure on startup
2019-09-18 10:54:00,093 - Initializing Spring FrameworkServlet 'dispatcherServlet'
2019-09-18 10:54:00,093 - FrameworkServlet 'dispatcherServlet': initialization started
2019-09-18 10:54:00,108 - FrameworkServlet 'dispatcherServlet': initialization completed in 15 ms
2019-09-18 10:54:00,343 - Started ServerConnector@7b3315a5{HTTP/1.1,[http/1.1]}{0.0.0.0:8081}
2019-09-18 10:54:00,355 - Jetty started on port(s) 8081 (http/1.1) with context path '/study005'
2019-09-18 10:54:00,355 - Started ThymeleafApplication in 4.556 seconds (JVM running for 5.139)
5、网页如下

springboot中使用jetty服务器_spring_02

举报

相关推荐

0 条评论