我想知道是否可以将带有MySQL数据库的spring boot应用程序部署到azure云中.我找不到任何说明或教程.
我的弹簧应用程序有问题,因为我试图包含一些安全性的东西.
在构建一个包含angularJS的小型工作应用程序后,我遵循了这个春季安全教程,但我无法启动它.当我尝试访问应用程序的任何部分时,安全模块想要重定向到http:// localhost:8080/login ...但找不到它.
出现意外错误(type = Not Found,status = 404).没有可用的消息
也许我只是错过了一件小事,但我无法弄清楚它是什么^^
这是我的代码......
文件夹结构:
src/main/java
+-Application.java
+-SecurityConfiguration.java
src/main/resources
+-static
+-index.html
+-templates
+-login.html
Run Code Online (Sandbox Code Playgroud)
pom.xml中:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.0.BUILD-SNAPSHOT</version>
</parent>
<!-- Additional lines to be added here... -->
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.3-1100-jdbc4</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
</dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)
Application.java:
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
@Configuration
@EnableAutoConfiguration
@ComponentScan
public …Run Code Online (Sandbox Code Playgroud)