Joh*_*erg 5 java spring tomcat spring-mvc intellij-idea
我最近使用INTELLIJ IDE完成了一个简单的spring boot应用程序。这些应用程序可以作为Spring应用程序在本地运行,也可以在Tomcat中运行。
对于我的下一步,我希望能够在线托管该应用程序,但是我所做的每一次尝试似乎都失败了,它甚至没有在Xampp的Tomcat上运行。
这是我的等级制度:
application.properties:
spring.datasource.driver-class-name = com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://xxx.xxx.xxx.xxx:3306/db_digitrainer
spring.datasource.username=test
spring.datasource.password=test
server.context-path=/digitrainer
management.context-path=/manage
Run Code Online (Sandbox Code Playgroud)
Application.java:
@SpringBootApplication
@Configuration
@EnableAutoConfiguration
@EnableWebMvc
@ComponentScan
public class Application extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(Application.class);
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
我一直无法找到有关如何执行此操作的任何明确信息,所以我很想知道我做错了什么,以及spring boot是否是开发rest API的方法。
归档时间: |
|
查看次数: |
3176 次 |
最近记录: |