Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Servlets 在jboss as 7.1.1上部署jsf2.1应用程序后,不显示欢迎页面_Servlets_Jsf 2_Jboss7.x_Web.xml - Fatal编程技术网

Servlets 在jboss as 7.1.1上部署jsf2.1应用程序后,不显示欢迎页面

Servlets 在jboss as 7.1.1上部署jsf2.1应用程序后,不显示欢迎页面,servlets,jsf-2,jboss7.x,web.xml,Servlets,Jsf 2,Jboss7.x,Web.xml,我将jboss的JSF2.1动态web应用程序设置为7.1.1运行时。我无法查看我的欢迎页面,即使在浏览器中键入页面名称也不行。我读了很多类似的问题,但都不适合我。这很奇怪,因为它以前工作过。在我将项目导入不同的工作区后,什么都没有。没有错误。以下是web.xml: <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:sche

我将jboss的JSF2.1动态web应用程序设置为7.1.1运行时。我无法查看我的欢迎页面,即使在浏览器中键入页面名称也不行。我读了很多类似的问题,但都不适合我。这很奇怪,因为它以前工作过。在我将项目导入不同的工作区后,什么都没有。没有错误。以下是web.xml:

<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_3_0.xsd" id="WebApp_ID" version="3.0">
    <display-name>JPAWEB</display-name>
    <welcome-file-list>
     <welcome-file>home.xhtml</welcome-file>
    </welcome-file-list>
    <context-param>
     <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
     <param-value>.xhtml</param-value>
    </context-param>
    <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>
    </web-app>

日本广播公司
home.xhtml
javax.faces.DEFAULT_后缀
.xhtml
Facesservlet
javax.faces.webapp.FacesServlet
1.
Facesservlet
*.xhtml
我确实在WebContent下有home.xhtml。
在浏览器中,我得到了一个服务器,但在本地主机上找不到服务器,即使我放置了。
只是说,服务器正在工作,我可以打开控制台和欢迎页面


有什么想法吗?一切似乎都很好,但是。。。帮助:)

我不确定您是否可以使用相同的扩展来映射JSF Front controller的xhtml facelet和url模式(我非常确定没有),因此请尝试更改此值,首先更改url模式,以便:

<servlet-mapping>
     <servlet-name>Faces Servlet</servlet-name>
     <url-pattern>*.jsf</url-pattern>
</servlet-mapping>

Facesservlet
*.jsf
以及您的欢迎文件,以便:

<welcome-file-list>
     <welcome-file>home.jsf</welcome-file>
</welcome-file-list>

home.jsf

我解决了它。代码还可以。浏览器Firefox v26和JBoss AS 7.1.1存在问题

Firefox的问题似乎很常见:

问题1-默认情况下,Firefox通过添加www.and.com来更改URL,这可以在问题文本中看到

解决方案:
在地址栏中键入about:config。
在“过滤器”框中键入fixup。
双击browser.fixup.alternate.enabled将其值更改为false

问题2-默认情况下,Firefox不显示完整的URL

解决方案:
在地址栏中键入about:config。
在“过滤器”框中键入browser.urlbar.trimURL。
双击browser.urlbar.trimURLs将其值更改为false

JBossAS 7.1.1的问题是本地主机URL。通常使用localhost:8080,但现在使用127.0.0.1:8080

就这样