【发布时间】:2014-06-27 19:23:30
【问题描述】:
我有一个 login.xhtml 文件,它在 Firefox 中显示良好,但是当我在 Internet Explorer 中打开同一页面时,我得到一个空白页面,其中只有 CSS 文件设置的背景颜色。我试过IE8和IE10。在我的任何其他 JSF 项目中,我都没有遇到过在 IE 中显示 JSF 代码的问题。同样,该程序在 Firefox 中完美运行。有关如何解决此问题的任何建议?
这是我的 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。
【问题讨论】: