【发布时间】:2017-07-04 09:13:19
【问题描述】:
问题 1:Angular 2 应用程序部署在 JBOSS 服务器上但无法加载静态内容 (js/css)。问题是网站托管在它自己的上下文(localhost:8080/sample/)下,静态资源在 index.html 中被称为(link href="css/index.css" rel="stylesheet")但是它没有得到在对 localhost:8080/css/index.css 进行网络调用时加载。
我需要它指向 localhost:8080/sample/css/index.css
问题 2:或者,我们尝试在 tomcat 上托管 Angular 应用程序,但服务需要托管在 jboss 上,我们尝试实现 CROS 过滤器 (https://amodernstory.com/2014/12/27/using-cors-headers-with-java-example/) 但第一个请求通过但其他请求在 Chrome 网络选项卡中显示待处理状态。
【问题讨论】: