Package org.apache.ofbiz.webapp.view
Interface ViewHandler
- All Known Implementing Classes:
AbstractViewHandler
,FreeMarkerViewHandler
,HttpViewHandler
,JspViewHandler
,JspViewHandler
,MacroScreenViewHandler
,ScreenFopViewHandler
,SimpleContentViewHandler
public interface ViewHandler
ViewHandler - View Handler Interface
-
Method Summary
Modifier and TypeMethodDescriptiongetName()
Gets the name of the view handler as declared in the controller configuration file.void
init
(ServletContext context) Initializes the handler.prepareViewContext
(HttpServletRequest request, HttpServletResponse response, ConfigXMLReader.ViewMap viewMap) Before call the render, this function have to purpose to analyse, secure and prepare the contextvoid
render
(String name, String page, String info, String contentType, String encoding, HttpServletRequest request, HttpServletResponse response, Map<String, Object> context) Render the page.void
Sets the name of the view handler as declared in the controller configuration file.
-
Method Details
-
setName
Sets the name of the view handler as declared in the controller configuration file.- Parameters:
name
- String The name of the view handler as declared in the controller configuration file.
-
getName
String getName()Gets the name of the view handler as declared in the controller configuration file.- Returns:
- name String The name of the view handler as declared in the controller configuration file.
-
init
Initializes the handler. Since handlers use the singleton pattern this method should only be called the first time the handler is used.- Parameters:
context
- ServletContext This may be needed by the handler in order to lookup properties or XML definition files for rendering pages or handler options.- Throws:
ViewHandlerException
-
render
void render(String name, String page, String info, String contentType, String encoding, HttpServletRequest request, HttpServletResponse response, Map<String, Object> context) throws ViewHandlerExceptionRender the page.- Parameters:
name
- The name of the view.page
- The source of the view; could be a page, url, etc depending on the type of handler.info
- An info string attached to this viewrequest
- The HttpServletRequest object used when requesting this page.response
- The HttpServletResponse object to be used to present the page.context
- The context prepare by the handler to run- Throws:
ViewHandlerException
-
prepareViewContext
Map<String,Object> prepareViewContext(HttpServletRequest request, HttpServletResponse response, ConfigXMLReader.ViewMap viewMap) Before call the render, this function have to purpose to analyse, secure and prepare the context- Parameters:
request
-response
-viewMap
-- Returns:
-