英文:
Static website hosting in Websphere server
问题
以下是翻译好的内容:
我对WebSphere还不熟悉,正在尝试在WebSphere中托管静态网站,并寻找将URL重定向到index.html以使客户端路由正常工作的方法。
我创建了WEB-INF和web.xml以实现路由,但似乎没有起作用。
MyApp
---- WEB-INF
-------- web.xml
---- index.html
web.xml的创建如下所示:
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<error-page>
<error-code>404</error-code>
<location>/index.html</location>
</error-page>
</web-app>
我是否漏掉了什么?当我直接浏览URL时,仍然显示404错误,这意味着路由没有生效。
例如:domain/example/1
有什么处理这个问题的想法/建议吗?
谢谢
英文:
I am new to Websphere and trying to host a static website in web sphere and looking for the redirection of URLs to index.html to make client side routing work.
I created the WEB-INF and web.xml to achieve routing but it doesnt seems working.
MyApp
---- WEB-INF
-------- web.xml
---- index.html
The web.xml is created like below
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
         http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">
    <error-page>
<error-code>404</error-code>
<location>/index.html</location>
</error-page>
</web-app>
Am i missed anything, when i browse urls directly i am still getting 404, means the routing is not picking.
Eg: domain/example/1
Any idea/suggestion to handle this.
Thanks
专注分享java语言的经验与见解,让所有开发者获益!
评论