小编Rom*_*pin的帖子

使用 Wildfly 提供静态内容(单页应用程序)

我需要使用 Wildfly 应用服务器在 WAR 之外提供静态内容。我设置

   <host name="default-host" alias="localhost">
                    <location name="/" handler="welcome-content"/>
                    <filter-ref name="server-header"/>
                    <filter-ref name="x-powered-by-header"/>
   </host>
    <handlers>
                <file name="welcome-content" path="c:/Users/admin/web" directory-listing="true"/>
            </handlers>
Run Code Online (Sandbox Code Playgroud)

一切正常,但我遇到了路由问题。该应用程序具有 html5 历史支持。当我转到 Url: localhost:8080 一切正常时,我的应用程序重定向到 /home 但是当我刷新页面时,它返回 404 错误。

是否可以将位置名称定义为通配符,例如 /* 或者如何解决单页应用程序的问题?

single-page-application wildfly undertow wildfly-10

5
推荐指数
0
解决办法
223
查看次数