我有一個在Firefox中顯示正常的login.xhtml文件,但是當我在Internet Explorer中打開相同頁面時,只有CSS文件設置的背景顏色。我已經嘗試過IE8和IE10。在我的其他任何JSF項目中,我都沒有在IE中顯示JSF代碼的麻煩。同樣,該程序在Firefox中完美運行。有關如何解決這個問題的任何建議?JSF在Firefox中工作,但在Internet Explorer中爲空白頁面
這裏是我的login.xhtml文件:
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<f:facet name="first">
<meta http-equiv="X-UA-Compatible" content="IE=8" />
</f:facet>
<f:facet name="last">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link type="text/css" rel="stylesheet" href="#{request.contextPath}/css/global.css" />
<title>Annual Review</title>
</f:facet>
</h:head>
<h:body>
<p:layout fullpage="true" >
<p:layoutUnit position="north" size="80" minSize="80" maxSize="80">
<p:panelGrid styleClass="menuBarGrid" columns="2">
<p:graphicImage url="/css/NeedhamLogo2.bmp" />
<h:outputText value="Annual Compliance Questionnaire" />
</p:panelGrid>
</p:layoutUnit>
</p:layout>
</h:body>
</html>
我的web.xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>AnnualReview</display-name>
<welcome-file-list>
<welcome-file>login.xhtml</welcome-file>
</welcome-file-list>
<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>
<context-param>
<description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<resource-ref>
<res-ref-name>jdbc/annual_review</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
我使用JSF 2.2,Primefaces 4.0和Glassfish 4.