What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

JSF 2.3 lets CDI inject certain JSF accessor maps with generic types, so you can express the map’s key and value types at the injection point. This is a specific CDI integration feature—not a new Java generics system and not permission to make every JSF injection point generic. It requires a container that supports CDI 2.0.

What “generic parameters” means in JSF 2.3

In this context, the parameters are Java type arguments on maps injected through JSF’s CDI qualifiers. JSF accessors expose maps for application, session, view, and related scopes; the 2.3 specification connects the relevant annotations to those accessor maps and states, “Generics may be used.” See the JavaServer Faces 2.3 Final Specification (JSR 372), §§5.9–5.9.1.

The scope is important: this does not mean JSF 2.3 introduced generics to Java, or that any JSF object can be injected with arbitrary type parameters. It concerns the map-valued artifacts associated with the specified JSF accessors.

How to inject a JSF map with a generic type

Use the CDI qualifier for the accessor map you need, and put the map’s type arguments on the injection point. For example, a session map can be requested as a map with string keys and object values:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import java.util.Map;
import javax.faces.annotation.SessionMap;
import javax.inject.Inject;

public class SessionData {
    @Inject
    @SessionMap
    private Map<String, Object> sessionMap;
}

Here, @SessionMap identifies the JSF session-map artifact, while Map<String, Object> states the type expected by the Java code. Choose type arguments that fit how your application uses the map; the injection qualifier selects the JSF artifact, not a particular application-specific key or value.

This example uses the javax.faces package names of JSF 2.3. Do not silently substitute jakarta.faces names when targeting this version.

Which JSF artifacts can be injected?

Mojarra 2.3’s implementation documentation lists these injectable artifacts:

  • applicationMap
  • externalContext
  • facesContext
  • session
  • sessionMap
  • view
  • viewMap

The map-specific generic discussion applies to map-valued accessors; it does not turn objects such as FacesContext or ExternalContext into maps. For the list and setup note, see Mojarra 2.3 “What’s New”.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What your runtime must support

This is a CDI integration feature. The JSF 2.3 specification says, “As of version 2.3 of this specification, JSF must run in a container that supports CDI version 2.0.” The requirement appears in §5.9 of the final specification. If injection fails, check that CDI is available and enabled in the application’s actual server and deployment configuration.

Mojarra’s 2.3 documentation says its listed injection feature is enabled by a faces-config.xml declared as version 2.3. Treat that as Mojarra-specific setup guidance, not a universal configuration rule: verify the requirements for your exact JSF implementation and container before changing configuration.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How this fits into JSF 2.3

JSF 2.3 was the Java EE 8-era release of the framework. The project describes it as the designated Java EE 8 user-interface standard, and the Jakarta Server Faces 2.3 specification page identifies it as the first release for Jakarta EE 8. Its historical API coordinate is javax.faces; the page lists version 2.3.2. These are version-history details, not a recommendation to start a new project on those artifacts.

Generic map injection was one part of a broader update that emphasized CDI alignment alongside features such as WebSocket integration, multi-field validation, Java Time support, and lifecycle and AJAX improvements. JSF 2.3 also deprecated the native javax.faces.bean managed-bean package in favor of CDI-based approaches. For the release context, consult the official JSF 2.3 feature overview and the JSR 372 final specification release page.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.