[英]Spring MVC and AngularJS routing conflict
嗨,大家好。 我在Spring MVC和AngularJS之间路由时遇到问题。
因此,当我进入主页时: http:// localhost:8080 /捕获了Angular及其确定,但是当我想转到另一个页面时,例如http:// localhost:8080 / dashboard捕获了Spring MVC和Tomcat显示错误404 Not Found 。 要进入需要的仪表板,请使用url /#/ dashbaord
虽然我在路由配置文件中得到了以下代码。
是否有可能首先考虑角度,然后考虑Spring MVC?
$locationProvider.html5Mode({
enabled : true,
requireBase : false
});
问候
您需要将所有Tomcat URL路由到index.html
对于对Spring Boot http:// localhost:8080 / springbootapi / wotever的 API调用
在Tomcat中说不要将带有/ springbootapi /的URL指向POINT.html
除index.html外的所有内容
将其他所有内容都指向index.html可以使Angular完全控制除API调用之外的所有内容
上面概述了执行此操作的通用方法。
也许更好地按照本教程...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.