View engines are responsible for processing views and are discovered using CDI. Implementations must look up all instances of this interface, and process a view as follows:
supports(String)
and discarding engines that return false.javax.annotation.Priority to indicate
their priority; otherwise the priority is assumed to be ViewEngine#PRIORITY_APPLICATION.javax.mvc.event.BeforeProcessViewEvent event.processView(ViewEngineContext) to process view.javax.mvc.event.AfterProcessViewEvent event.The default view engines for JSPs and Facelets use file extensions to determine
support. Namely, the default JSP view engine supports views with extensions jsp
and jspx, and the one for Facelets supports views with extension
xhtml.
javax.annotation.Priority, javax.mvc.event.BeforeProcessViewEvent
| Modifier and Type | Field and Description |
|---|---|
| public static final String | DEFAULT_VIEW_FOLDER
Default value for property |
| public static final int | PRIORITY_APPLICATION
Recommended priority for all application-provided view engines (default). |
| public static final int | PRIORITY_BUILTIN
Priority for all built-in view engines. |
| public static final int | PRIORITY_FRAMEWORK
Recommended priority for all view engines provided by frameworks built on top of MVC implementations. |
| public static final String | VIEW_FOLDER
Name of property that can be set to override the root location for views in an archive. |
| Modifier and Type | Method and Description |
|---|---|
| public void | processView(ViewEngineContext
the context needed for processing. context)Process a view given a |
| public boolean |
| DEFAULT_VIEW_FOLDER | back to summary |
|---|---|
| public static final String DEFAULT_VIEW_FOLDER Default value for property | |
| PRIORITY_APPLICATION | back to summary |
|---|---|
| public static final int PRIORITY_APPLICATION Recommended priority for all application-provided view engines (default). | |
| PRIORITY_BUILTIN | back to summary |
|---|---|
| public static final int PRIORITY_BUILTIN Priority for all built-in view engines. | |
| PRIORITY_FRAMEWORK | back to summary |
|---|---|
| public static final int PRIORITY_FRAMEWORK Recommended priority for all view engines provided by frameworks built on top of MVC implementations. | |
| VIEW_FOLDER | back to summary |
|---|---|
| public static final String VIEW_FOLDER Name of property that can be set to override the root location for views in an archive. | |
| processView | back to summary |
|---|---|
| public void processView(ViewEngineContext context) throws ViewEngineException Process a view given a Following the Java EE threading model, the underlying view engine implementation must support this method being called by different threads. Any resources allocated during view processing must be released before the method returns.
| |
| supports | back to summary |
|---|---|
| public boolean supports(String view) Returns
| |