public interface ViewEngine
View engines are responsible for processing views and are discovered using CDI. Implementations must inject all instances of this interface, and process a view as follows:
supports(String)and discarding engines that return
Priorityto indicate their priority; otherwise the priority is assumed to be
ViewEngineSelectedevent to inform observers of the selection.
Once a view engine is selected, the method
called to process the view.
The default view engines for JSPs and Facelets use file extensions to determine
support. Namely, the default JSP view engine supports views with extensions
jspx, and the one for Facelets supports views with extension
|Modifier and Type||Field and Description|
Default value for property
Name of property that can be set in an application's
static final String VIEW_FOLDER
Configurationto override the root location for views in an archive.
Application.getProperties(), Constant Field Values
boolean supports(String view)
trueif this engine can process the view or
view- the view.
void processView(ViewEngineContext context) throws ViewEngineException
ViewEngineContext. Processing a view involves merging the model and template data and writing the result to an output stream.
context- the context needed for processing.
ViewEngineException- if an error occurs during processing.
Copyright © 2015 Oracle Corporation. All rights reserved.