创建了一个Spring Boot REST应用程序。
作为Spring启动应用运行
在月食中以 if (code.contains("#")){
Intent i = new Intent();
i.setaction(Intent.actION_DIAL);
i.setData(Uri.parse("tel:"+Uri.encode(code))); //here add Uri.encode
context.startactivity(i);
}
的身份运行时。效果很好。
REST API正在使用URL-spring boot application
在Tomcat上部署为WAR
我遵循以下步骤
- 主类扩展了
http://localhost:8080/schools
SpringServletContainerInitializer
- 在
@SpringBootApplication public class RmsBackendApplication extends SpringServletContainerInitializer { public static void main(String[] args) { SpringApplication.run(RmsBackendApplication.class,args); } }
中添加了开始课程条目
pom.xml
- 添加了启动器tomcat依赖项
<properties>
<java.version>1.8</java.version>
<start-class>com.codingParkFun.rmsbackend.RmsBackendApplication</start-class>
</properties>
-
很少有文档说覆盖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency>
的{{1}}方法。但就我而言,configure
没有SpringServletContainerInitializer
方法。我下载了Spring Tools 4.0 -
使用
SpringServletContainerInitializer
生成的软件包。战争包裹的生成名称为configure
-
在warcat(版本
maven install
)上部署war软件包 -
访问REST API URL-
rms-0.0.1-snAPSHOT.war
- Tomcat本地主机日志如下:
9.0.27
不确定应用程序REST API何时不起作用。请指导。