【发布时间】:2018-06-29 09:12:25
【问题描述】:
我已经使用哈希定位策略实现了一个 Angular 6 应用程序,并希望将其部署为 Wildfly 中的 WAR。应用程序运行良好,但是重新加载页面(例如http://localhost:9390/MyApp/app/#/login)会导致 403 禁止错误。这是设置:
WAR 文件:
/app/* -> angular app generated by ng-cli
/error403.html -> simple error page
/WEB-INF
/WEB-INF/web.xml
/WEB-INF/classes/... REST services
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>MyApp</display-name>
<welcome-file-list>
<welcome-file>app/index.html</welcome-file>
</welcome-file-list>
<error-page>
<error-code>403</error-code>
<location>/error403.html</location>
</error-page>
</web-app>
感谢您的帮助。
【问题讨论】:
标签: angular wildfly war http-status-code-403