View engines are responsible for processing views and are discovered using Jakarta Contexts and Dependency Injection. Implementations must look up all instances of this interface, and process a view as follows:
supports(String)
and discarding engines that return false.jakarta.annotation.Priority to indicate
their priority; otherwise the priority is assumed to be ViewEngine#PRIORITY_APPLICATION.jakarta.mvc.event.BeforeProcessViewEvent event.processView(ViewEngineContext) to process view.jakarta.mvc.event.AfterProcessViewEvent event.The default view engine for Jakarta Server Pages uses file extensions to determine
support. Namely, the default Jakarta Server Pages view engine supports views with extensions jsp
and jspx.
jakarta.annotation.Priority , jakarta.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_EXTENSION
The default view file extension that is used to fetch templates. |
| 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_EXTENSION | back to summary |
|---|---|
| public static final String VIEW_EXTENSION The default view file extension that is used to fetch templates. For example, if this setting is set to | |
| 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 Jakarta 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
| |