-
Notifications
You must be signed in to change notification settings - Fork 11
Special Injections
Besides injecting a component using the @In
annotation, Seam 2 provides access to special injectable objects. These are listed below
The @RequestParameter
annotation triggers injection of an HTTP request parameter. The parameter name can be set explicitly as a value of the annotation or can be implied from the name of an injection point.
@RequestParameter
private Long id;
Java EE 6 doesn’t have an annotation for this, however, the JSF 2 spec now has <f:viewParam />
which can be used instead.
Seam 2 provides a built-in logger implementation. It is a thin wrapper that delegates to an available logging framework (log4j or JDK logging). Besides, it provides extra features such as EL expression evaluation.
Java EE 6 does not have anything the correlates.
In the old JSF 1.x days, due to limitations of the Expression Language, it was common to use data collections wrapped within DataModel objects from a JSF data table. This allowed the backing bean to obtain the selected row of the data table on postback.
Seam 2 makes this task easier by wrapping data collections within appropriate DataModel
subclass automatically. In addition, once a data model row is selected, the selected item (or selected row number) can be injected by Seam.
In Java EE 6, the Expression Language Specification evolved and allows parameters to be passed to EL method expressions. This approach should be used as a replacement for the @DataModel*
functionality. Java EE 6 does not provide a substitute for the @DataModel*
functionality.