【发布时间】:2014-09-10 08:12:34
【问题描述】:
我使用 Spring Boot 启动我的 Web 应用程序。它使用一个简单的主类来启动一个嵌入式 tomcat 服务器:
@Configuration
@EnableAutoConfiguration
@ComponentScan
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
我想以他可以处理将被激活的angularjs html5mode的方式配置服务器
$locationProvider.html5Mode(true);
其他用户的相关帖子显示需要重定向到root。 html5 模式从 url 中删除 hashbag。如果您刷新页面,服务器不会找到该页面,因为他不处理哈希。见:AngularJS - Why when changing url address $routeProvider doesn't seem to work and I get a 404 error
【问题讨论】:
-
我认为那里没有足够的信息来了解您做了什么,以及为什么它不起作用。
标签: html angularjs angular spring spring-boot