- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个使用 JSF2 和 Icefaces3 实现的应用程序,我在样式表应用程序中遇到问题。在登录时样式表正确应用,但在每次重定向后它不再正确。此问题仅在 IE 浏览器中发现。在 faces-config.xml 文件中,当我删除重定向标记 () 时,一切正常,除了 URL 没有更改并且它没有考虑标记:我添加以强制兼容模式。对于样式表的导入,我尝试了几个公式:
<!-- formule 1-->
<ice:outputStyle
href="#{facesContext.externalContext.requestContextPath}/resources/css/global.css"
rel="stylesheet" type="text/css" />
<!-- formule 2-->
<ice:outputStyle
href="#{request.contextPath}/resources/css/global.css"
rel="stylesheet" type="text/css" />
<!-- formule 3-->
<ice:outputStyle
href="/resources/css/global.css"
rel="stylesheet" type="text/css" />
<!-- formule 4-->
<link href="#{facesContext.externalContext.requestContextPath}/resources/css/global.css" rel="styleSheet" type="text/css"/>
<!-- formule 5-->
<link href="#{request.contextPath}/resources/css/global.css" rel="styleSheet" type="text/css"/>
faces-config.xml :
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
<application>
<variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
<variable-resolver>org.springframework.web.jsf.SpringBeanVariableResolver</variable-resolver>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
</application>
<managed-bean>
<managed-bean-name>renderManager</managed-bean-name>
<managed-bean-class>com.icesoft.faces.async.render.RenderManager</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
<factory>
<exception-handler-factory>
com.omb.exception.CustomExceptionHandlerFactory
</exception-handler-factory>
</factory>
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>homeHotel</from-outcome>
<to-view-id>/pages/home/home.xhtml</to-view-id>
<redirect />
</navigation-case>
<navigation-case>
<from-outcome>disconnect</from-outcome>
<to-view-id>/login.xhtml</to-view-id>
<redirect />
</navigation-case>
<navigation-case>
<from-outcome>error</from-outcome>
<to-view-id>/pages/errors/technicalError.xhtml</to-view-id>
<redirect />
</navigation-case>
<navigation-case>
<from-outcome>sessionExpired</from-outcome>
<to-view-id>login.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
网络.xml :
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>MyApplication</display-name>
<description>MyApplication</description>
<!-- Without this param upload does not work at 1st time with IceFaces 3.3.0 -->
<context-param>
<param-name>org.icefaces.mandatoryResourceConfiguration</param-name>
<param-value>all</param-value>
</context-param>
<context-param>
<param-name>facelets.FACELETS_LIBRARIES</param-name>
<param-value>/pages/templates/tags.taglib.xml</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/appCtx/**/*applicationContext*.xml
</param-value>
</context-param>
<!-- Facelet Config -->
<!-- <context-param> <param-name>javax.faces.application.CONFIG_FILES</param-name>
<param-value> /WEB-INF/faces-config-application-beans.xml, /WEB-INF/faces-config-navigation.xml
</param-value> </context-param> -->
<!-- <context-param> <param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value> </context-param> -->
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.VALIDATE_EMPTY_FIELDS</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>javax.faces.FACELETS_REFRESH_PERIOD</param-name>
<param-value>-1</param-value>
</context-param>
<context-param>
<param-name>com.icesoft.faces.standardRequestScope</param-name>
<param-value>false</param-value>
</context-param>
<!-- Specifies to the ICEfaces framework whether to support multiple views
of a single application from the same browser. When running in a Portlet
environment, this parameter must be set to true. -->
<context-param>
<param-name>com.icesoft.faces.concurrentDOMViews</param-name>
<param-value>false</param-value>
</context-param>
<!-- Specifies to the ICEfaces framework that synchronous update mode is
to be used. By default, ICEfaces uses asynchronous update mode to support
server-initiated updates (AJAX push). Setting to true will enable synchronous
update mode and disable AJAX push features. -->
<context-param>
<param-name>com.icesoft.faces.synchronousUpdate</param-name>
<param-value>true</param-value>
</context-param>
<!-- Specifies to the ICEfaces framework whether to compress the server-side
DOM representation after each response. This saves a considerable amount
of of memory per client. However, since this is decompressed/compressed for
every update, it may not bring significant memory savings to applications
that make frequent use of AJAX push. -->
<context-param>
<param-name>com.icesoft.faces.compressDOM</param-name>
<param-value>true</param-value>
</context-param>
<!-- Specifies the amount of time in milliseconds that the bridge will wait
for a response from the server for a user-initiated request before declaring
the connection lost. Un-comment and change the default value, if necessary. -->
<context-param>
<param-name>com.icesoft.faces.connectionTimeout</param-name>
<param-value>300000</param-value>
</context-param>
<!-- Specifies the amount of time in milliseconds that an idle asynchronous
blocking connection should be held open before being released. Normally,
the blocking connection is closed and re-opened with every communication
to the browser, such as user interaction or a heartbeat ping. The purpose
of this setting is to remove the possibility of threads being held blocked
for a long duration on a dead or completely inactive client connection. This
value should be longer than the heartbeat interval to avoid unnecessary network
traffic. Un-comment and change the default value, if necessary. -->
<context-param>
<param-name>
com.icesoft.faces.blockingConnectionTimeout
</param-name>
<param-value>90000</param-value>
</context-param>
<!-- Specifies the amount of time in milliseconds between heartbeat messages.
Un-comment and change the default value, if necessary. -->
<context-param>
<param-name>com.icesoft.faces.heartbeatInterval</param-name>
<param-value>50000</param-value>
</context-param>
<!-- Specifies how many consecutive heartbeat connection attempts may fail
before the connection is considered lost. Un-comment and change the default
value, if necessary. -->
<context-param>
<param-name>com.icesoft.faces.heartbeatRetries</param-name>
<param-value>2</param-value>
</context-param>
<!-- Specifies the number of milliseconds that a heartbeat request waits
for a successful response before it is considered timed out. Un-comment and
change the default value, if necessary. -->
<context-param>
<param-name>com.icesoft.faces.heartbeatTimeout</param-name>
<param-value>60000</param-value>
</context-param>
<!-- Specifies a page URI to redirect the client to when an asynchronous
connection is lost. The parameter value must be surrounded by single quotes.
Un-comment and change the default value, if necessary. -->
<context-param>
<param-name>
com.icesoft.faces.connectionLostRedirectURI
</param-name>
<param-value>login.xhtml</param-value>
</context-param>
<context-param>
<param-name>
com.icesoft.faces.sessionExpiredRedirectURI
</param-name>
<param-value>login.xhtml</param-value>
</context-param>
<context-param>
<param-name>com.icesoft.faces.blockUIOnSubmit</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.icefaces.ace.fileEntry.requireJavascript</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.properties</param-value>
</context-param>
<context-param>
<param-name>log4jExposeWebAppRoot</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>javax.faces.FACELETS_DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<filter>
<filter-name>springFilter</filter-name>
<filter-class>
org.springframework.web.filter.RequestContextFilter
</filter-class>
</filter>
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
<init-param>
<param-name>singleSession</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>openSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>springFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- <filter-mapping> <filter-name>loggedInFilter</filter-name> <url-pattern>/pages/*</url-pattern>
</filter-mapping> -->
<!-- SPRING -->
<listener>
<listener-class>
org.springframework.web.util.Log4jConfigListener
</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.util.IntrospectorCleanupListener
</listener-class>
</listener>
<!-- Listener d'initialisation de l'application -->
<listener>
<listener-class>com.omb.listeners.MyServletContextListener</listener-class>
</listener>
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.CompatResourceServlet</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>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/icefaces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/xmlhttp/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
<!-- Welcome files -->
<welcome-file-list>
<welcome-file>login.xhtml</welcome-file>
</welcome-file-list>
<error-page>
<error-code>500</error-code>
<location>/pages/error.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.RuntimeException</exception-type>
<location>/pages/error.jsp</location>
</error-page>
</web-app>
登录.xhtml :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:ace="http://www.icefaces.org/icefaces/components"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<!-- ice:outputStyle href="/resources/css/global.css" rel="stylesheet"
type="text/css" /-->
<ice:outputStyle
href="#{facesContext.externalContext.requestContextPath}/resources/css/myCss.css"
rel="stylesheet" type="text/css" />
</h:head>
<h:body onload='document.getElementById("loginForm:login").focus()'>
<ice:form id="loginForm">
<h:panelGroup id="page" styleClass="mainMaster" layout="block">
<h:panelGroup id="header" styleClass="header" layout="block">
<h:panelGroup styleClass="logo" layout="block">
<ice:graphicImage styleClass="imgLogo"
value="/resources/images/common/logo/Logo.png" />
</h:panelGroup>
</h:panelGroup>
<h:panelGroup id="content" styleClass="mainContent" layout="block">
<h:panelGroup styleClass="content" layout="block">
<h:panelGroup styleClass="txtLogin" layout="block">
<span><ice:outputLabel value="#{msg['login']}" /> : * </span>
<ice:inputText value="#{loginBean.login}" id="login" />
</h:panelGroup>
<h:panelGroup styleClass="txtLogin" layout="block">
<span><ice:outputLabel value="#{msg['password']}" /> : *</span>
<ice:inputSecret value="#{loginBean.password}"
action="#{loginBean.doLogin}" />
<br />
<span></span>
</h:panelGroup>
<h:panelGroup styleClass="txtLogin" layout="block">
<span></span>
<ice:commandButton id="loginButton" value="#{msg['log.on']}"
action="#{loginBean.doLogin}" />
</h:panelGroup>
<h:panelGroup layout="block">
<ace:panel style="border: 0px;">
<ace:message id="formMsg" for="loginForm" initEffect="slide" />
</ace:panel>
</h:panelGroup>
</h:panelGroup>
</h:panelGroup>
<h:panelGroup id="footer" styleClass="footer" layout="block">
<ui:insert name="footer">
<ui:include src="/pages/layer/footer/footer.xhtml" />
</ui:insert>
</h:panelGroup>
</h:panelGroup>
</ice:form>
</h:body>
</html>
模板.xhtml :
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:ice="http://www.icesoft.com/icefaces/component">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<title><ui:insert name="title">MyApplication</ui:insert></title>
<ice:outputStyle href="/xmlhttp/css/xp/xp.css" rel="stylesheet"
type="text/css" />
<!-- ice:outputStyle href="#{request.contextPath}/resources/css/global.css" rel="stylesheet" type="text/css" /-->
<ice:outputStyle
href="#{facesContext.externalContext.requestContextPath}/resources/css/global.css"
rel="stylesheet" type="text/css" />
<script type="text/javascript">
jsf.ajax.addOnError(function(data) {
if (data.responseText.indexOf("SessionExpiredException") > 0) {
window.location = "login.xhtml";
}
});
// French initialization
ice.ace.locales['fr'] = {
closeText : 'Fermer',
prevText : 'Précédent',
nextText : 'Suivant',
currentText : 'Courant',
monthNames : [ 'Janvier', 'Février', 'Mars', 'Avril', 'Mai',
'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre',
'Novembre', 'Décembre' ],
monthNamesShort : [ 'Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Jun',
'Jul', 'Aoû', 'Sep', 'Oct', 'Nov', 'Déc' ],
dayNames : [ 'Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi',
'Vendredi', 'Samedi' ],
dayNamesShort : [ 'Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam' ],
dayNamesMin : [ 'Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa' ],
weekHeader : 'Sm',
dateFormat : 'dd/mm/yy',
firstDay : 1,
isRTL : false,
showMonthAfterYear : false,
yearSuffix : ''
};
</script>
</h:head>
<h:body>
<h:panelGroup id="page" styleClass="mainMaster" layout="block">
<h:panelGroup id="header" styleClass="header" layout="block">
<ui:insert name="header">
<ui:include
src="/pages/layer/header/#{contextBean.templateHeaderName}" />
</ui:insert>
</h:panelGroup>
<h:panelGroup id="headerMenu" styleClass="menu" layout="block">
<ui:insert name="buttons">
<ui:include
src="/pages/layer/menu/#{contextBean.templateMenuButtonName}" />
</ui:insert>
</h:panelGroup>
<h:panelGroup id="main" styleClass="mainContent" layout="block">
<h:panelGroup id="content" styleClass="content" layout="block">
<h:panelGroup layout="block"
rendered="#{not facesContext.validationFailed and not empty facesContext.messageList}">
<h:messages id="psuedoGlobalMessages" globalOnly="true"
infoStyle="color:blue" errorStyle="color:red"
warnClass="color:orange" showDetail="false" showSummary="true" />
</h:panelGroup>
<ui:insert name="content" />
</h:panelGroup>
</h:panelGroup>
<h:panelGroup id="footer" styleClass="footer" layout="block">
<ui:insert name="footer">
<ui:include src="/pages/layer/footer/footer.xhtml" />
</ui:insert>
</h:panelGroup>
</h:panelGroup>
</h:body>
</html>
最佳答案
我找到了解决方案:
首先,我更改了 login.xhtml 页面的实现,以便它也包含在我的 Facelet 模板中。
其次:我在 template.xhtml 的开头添加了 DOCTYPE balise
现在 sheetstyle 应用于所有页面。
对于兼容模式,我制作了一个设置属性的 HttpFilter:
((HttpServletResponse) response).setHeader("X-UA-Compatible", this.xuacompatible);
关于html - 在 IE8 网络浏览器上的 Icefaces 3 应用程序中重定向后未应用 CSS 样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24427617/
我正在尝试使用谷歌浏览器的 Trace Event Profiling Tool分析我正在运行的 Node.js 应用程序。选择点样本后,我可以在三种 View 之间进行选择: 自上而下(树) 自上而
对于一个可能是菜鸟的问题,我们深表歉意,但尽管在 SO 上研究了大量教程和其他问题,但仍找不到答案。 我想做的很简单:显示一个包含大量数据库存储字符串的 Android ListView。我所说的“很
我已经开始了一个新元素的工作,并决定给 Foundation 5 一个 bash,看看它是什么样的。在创建带有水平字段的表单时,我在文档中注意到的第一件事是它们使用大量 div 来设置样式。所以我在下
我有一个 Windows 窗体用户控件,其中包含一个使用 BeginInvoke 委托(delegate)调用从单独线程更新的第 3 方图像显示控件。 在繁重的 CPU 负载下,UI 会锁定。当我附加
我有一堆严重依赖dom元素的JS代码。我目前使用的测试解决方案依赖于 Selenium ,但 AFAIK 无法正确评估 js 错误(addScript 错误不会导致您的测试失败,而 getEval 会
我正在制作一款基于滚动 2D map /图 block 的游戏。每个图 block (存储为图 block [21][11] - 每个 map 总共 231 个图 block )最多可以包含 21 个
考虑到以下情况,我是前端初学者: 某个 HTML 页面应该包含一个沉重的图像(例如 - 动画 gif),但我不想强制客户缓慢地等待它完全下载才能享受一个漂亮的页面,而是我更愿意给他看一个轻量级图像(例
我正在设计一个小软件,其中包括: 在互联网上获取资源, 一些用户交互(资源的快速编辑), 一些处理。 我想使用许多资源(它们都列在列表中)来这样做。每个都独立于其他。由于编辑部分很累,我想让用户(可能
我想比较两个理论场景。为了问题的目的,我简化了案例。但基本上它是您典型的生产者消费者场景。 (我关注的是消费者)。 我有一个很大的Queue dataQueue我必须将其传输给多个客户端。 那么让我们
我有一个二元分类问题,标签 0 和 1(少数)存在巨大不平衡。由于测试集带有标签 1 的行太少,因此我将训练测试设置为至少 70-30 或 60-40,因此仍然有重要的观察结果。由于我没有过多地衡量准
我是一名优秀的程序员,十分优秀!