My JSF Books/Videos My JSF Tutorials OmniFaces/JSF PPTs
JSF 2.3 Tutorial
JSF Caching Tutorial
JSF Navigation Tutorial
JSF Scopes Tutorial
JSF Page Author Beginner's Guide
OmniFaces 2.3 Tutorial Examples
OmniFaces 2.2 Tutorial Examples
JSF Events Tutorial
OmniFaces Callbacks Usages
JSF State Tutorial
JSF and Design Patterns
JSF 2.3 New Features (2.3-m04)
Introduction to OmniFaces
25+ Reasons to use OmniFaces in JSF
OmniFaces Validators
OmniFaces Converters
JSF Design Patterns
Mastering OmniFaces
Reusable and less-verbose JSF code

My JSF Resources ...

Java EE Guardian
Member of JCG Program
Member MVB DZone
Blog curated on ZEEF
OmniFaces is an utility library for JSF, including PrimeFaces, RichFaces, ICEfaces ...

[OmniFaces Utilities] - Find the right JSF OmniFaces 2 utilities methods/functions

Search on blog

Petition by Java EE Guardians


duminică, 20 septembrie 2015

In JSF 2.3 the ExternalContext is available as an implicit object

JSF provides several objects related to the current request and environment. EL exposes these objects (known as implicit objects) that can be accessed at runtime in a Facelet, servlets, or backing bean—these objects are accessible through value expressions and are managed by the container. Beside the JSF 2.2 implicit objects, JSF 2.3 will allow developers to access the ExternalContext via an implicit object. Basically, we have:

JSF 2.2 - access ExternalContext via static method
ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();

OmniFaces static shortcut for ExternalContext
ExternalContext externalContext = Faces.getExternalContext();

JSF 2.3 - ExternalContext implicit object

JSF 2.3 CDI producer method for ExternalContext:
private ExternalContext externalContext;

Check out the entire list of JSF 2.3 CDI producer methods:

Niciun comentariu :

Trimiteți un comentariu


Postări populare

OmniFaces/JSF Fans

Follow by Email

Visitors Starting 4 September 2015

Locations of Site Visitors