相关疑难解决方法(0)

Spring-Boot:如何添加tomcat连接器以绑定到控制器

在Spring-Boot文档中,有一节描述了如何为tomcat启用多个连接器(http://docs.spring.io/spring-boot/docs/1.1.7.RELEASE/reference/htmlsingle/#howto- enable-multiple-connectors-in-tomcat).

但有没有办法简单地将连接器添加到现有连接器(Web和管理连接器)?并将它们绑定到一些mvc控制器?我想要做的是创建一些可以在不同端口上访问的Web服务.

java spring spring-boot

7
推荐指数
1
解决办法
5492
查看次数

在 Spring Boot 中,如何重定向上下文路径之外?

我有一个 Spring Boot 应用程序,在我定义的属性文件中:

server.servlet.context-path= /myapp
Run Code Online (Sandbox Code Playgroud)

如果我去的话,http://localhost/myapp我会看到一切都如预期的那样。但是,如果我转到:http://localhost我会看到来自 Apache Tomcat 的标准 404 错误页面。

如何在 Spring Boot 中设置从/到 的重定向?/myapp

或者/等效:我可以在单个 spring-boot 应用程序中设置多个上下文路径吗?

java tomcat spring-boot

1
推荐指数
1
解决办法
5789
查看次数

标签 统计

java ×2

spring-boot ×2

spring ×1

tomcat ×1