Mastering Java EE Development with WildFly
上QQ阅读APP看书,第一时间看更新

Model

The @Model annotation is an exclusive qualifier for the Model-View-Controller (MVC) web applications. It's of use to mark the models with this annotation:

@Named
@RequestScoped
@Documented
@Stereotype
@Target(value={TYPE,METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface Model

Here the properties inherited by the classes annotated with the @Model annotation are:

  • Reachable through EL script (Named).
  • Elaborated at runtime usually by a JSF engine (Retention).
  • Active at request scope (Request scope).
  • Stereotyped for internal use. A JSF could switch all models for a more stereotype, changing the configurations at runtime.