welcome-file-list被服务器忽略?

时间:2016-10-05 13:35:32

标签: jsf java-ee jboss wildfly

我在尝试重新配置我最近加入的项目的欢迎页面时遇到了问题。 使用JBoss 7和Wildfly 10来测试应用程序,但两台服务器都以同样的方式失败。

我希望能够使用以下网址访问我的网址:

http://localhost:8080/MaisAcoes/

我希望此网址显示“index.xhtml”页面。

问题是:服务器在尝试打开“index.jsf”时始终显示错误404(因为此页面不存在)。它不会打开“index.xhtml”页面。

的web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="3.1"
    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">
    <display-name>MaisAcoes</display-name>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>index.xhtml</welcome-file>
    </welcome-file-list>
</web-app>

index.xhtml页面位于WebContent文件夹并正确部署...如果我尝试直接访问该页面(http://localhost:8081/MaisAcoes/index.xhtml),页面将成功打开。

我错过了什么..?

1 个答案:

答案 0 :(得分:0)

正如成员 BalusC 在评论中指出的那样,只需清除浏览器的缓存即可解决此问题。

我曾尝试在服务器(JBoss 7和Wildfly 10)中执行完全清理,但这不起作用...清理浏览器的缓存解决了问题并使webapp加载右页。

相关问题