omnifaces

JSF 2 how to set html style depending on browser version

狂风中的少年 提交于 2019-12-06 13:09:39
问题 What i want to do in my JSF 2 application is to set proper html style depending on browser version, here is sample code: <!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> <!--[if IE 7]> <html class="lt-ie9 lt-ie8" lang="en"> <![endif]--> <!--[if IE 8]> <html class="lt-ie9" lang="en"> <![endif]--> <!--[if gt IE 8]><!--> <!--<![endif]--> How to do that in JSF 2? What is the best/simplest way? I found something interesting in Omnifaces ( o:conditionalComment ) but it

Implementing a Locale provider that works in JSF and JAX-RS

荒凉一梦 提交于 2019-12-06 11:37:56
I've been joyfully using omnifaces' Faces.getLocale() to aquire the locale used by the currently logged in user (which in turn gets this from a <f:view> definition). I really like the fallback approach from view to client to system default locale as it fits the requirements for locale selection in my application: If a user is logged in, use his language preference (obtained from the backend entity) If no user preference can be found, use the highest ranking language from the Accept-Languages HTTP header If no locale has been selected by now, use the system default. Now I've started using JAX

Script is not rendered after postback in a composite component added programmatically

柔情痞子 提交于 2019-12-06 11:14:24
I have this composite component: inputMask.xhtml <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:composite="http://xmlns.jcp.org/jsf/composite" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"> <composite:interface> <composite:attribute name="value" /> <composite:attribute name="mask" type="java.lang.String" required="true" /> <composite:attribute name="converterId" type="java.lang.String" default="br.edu.ufca.eventos.visao.inputmask.inputMask" /> </composite:interface> <composite:implementation> <h

Mojarra 2.1.14 flash scope messages and redirect to different path

流过昼夜 提交于 2019-12-06 10:17:54
According to this: http://java.net/jira/browse/JAVASERVERFACES-2136 flash-"scoped" messages should survive a redirect to a page on a different path.. I wanted to use something like this in my application so i downloaded javax.faces-2.1.14-20121003.074348-10 snapshot from here https://maven.java.net/content/repositories/snapshots/org/glassfish/javax.faces/2.1.14-SNAPSHOT/ to test. My situation is this: I have a page (call it test.xhtml) in the root directory that in the view-scoped backing bean during the call of the constructor does a check and conditionally sets a message using Omnifaces

Silence FullAjaxExceptionHandler

∥☆過路亽.° 提交于 2019-12-06 01:18:07
问题 So after being confronted with the dreaded javax.faces.application.ViewExpiredException , I had to go look around the internet to find the proper solution. Fortunately, the solutions are readily available and I went ahead and adopted the OmniFaces FullAjaxExceptionHandler. Enough said, as with pretty much everything from OmniFaces, it worked wonders. But, every time I have a view expiring I am getting : SEVERE: WebModule[/myModule]FullAjaxExceptionHandler: An exception occurred during

Adding composite component programmatically

元气小坏坏 提交于 2019-12-06 00:14:23
I would like to include below composite component programmatically: <composite:interface> <composite:attribute name="sampleBean" /> <composite:attribute name="autoCompleteMethod" method-signature="java.util.List autoCompleteMethod(java.lang.String)" /> </composite:interface> In Omnifaces , there is a function: // Programmatically include composite component. Components.includeCompositeComponent(someParentComponent, libraryName, resourceName, id); However, it isn't clear to me how to specify the autoCompleteMethod in the obtained UIComponent instance. How can I achieve this? The

FullAjaxExceptionHandler does not redirect to error page after invalidated session

一曲冷凌霜 提交于 2019-12-05 18:28:39
I am having issues with the Omnifaces FullAjaxExceptionHandler ( http://showcase.omnifaces.org/exceptionhandlers/FullAjaxExceptionHandler ). It does not redirect to the specified error page after the session is invalidated. I have the following in my faces-config: <factory> <exception-handler-factory>org.omnifaces.exceptionhandler.FullAjaxExceptionHandlerFactory</exception-handler-factory> </factory> And the following in my web.xml: <error-page> <exception-type>javax.faces.application.ViewExpiredException</exception-type> <location>/pages/error/viewExpired.html</location> </error-page> After I

h:body not rerendered when using FullAjaxExceptionHandler

 ̄綄美尐妖づ 提交于 2019-12-05 14:41:54
I'm using the OmniFaces FullAjaxExceptionHandler to display error pages. The error pages are shown correctly, but I'm having issues with the styling of those pages. My application is using a template which has CSS classes defined on the body element. These classes are different for normal and error pages: Normal page: <h:body styleClass="main-body layout-compact"> Error page: <h:body styleClass="exception-body error-page"> When the FullAjaxExceptionHandler processes an exception, a forward to the error page is performed (based on the <error-page> mechanism in web.xml ). Apparently this does

Why use omnifaces while I am using primefaces?

情到浓时终转凉″ 提交于 2019-12-04 20:35:37
问题 I need to know what the benefits of using OmniFaces would be versus PrimeFaces which I'm using at the moment. What features does OmniFaces offer that PrimeFaces doesn't? 回答1: They are different things and you can perfectly combine them. Omnifaces is a utility for JSF which enhances JSF itself. It's not intended to just provide built-in view components (even it has some of them), but to improve JSF standard API providing utilities as their own converters, filters, functions and validators.

JSF 2 how to set html style depending on browser version

∥☆過路亽.° 提交于 2019-12-04 18:43:39
What i want to do in my JSF 2 application is to set proper html style depending on browser version, here is sample code: <!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> <!--[if IE 7]> <html class="lt-ie9 lt-ie8" lang="en"> <![endif]--> <!--[if IE 8]> <html class="lt-ie9" lang="en"> <![endif]--> <!--[if gt IE 8]><!--> <!--<![endif]--> How to do that in JSF 2? What is the best/simplest way? I found something interesting in Omnifaces ( o:conditionalComment ) but it only allows conditional loading of entire css which is useless for me... BalusC It's not true that the