01: /*******************************************************************************
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: *******************************************************************************/package org.ofbiz.webapp.view;
19:
20: import javax.servlet.ServletContext;
21: import javax.servlet.http.HttpServletRequest;
22: import javax.servlet.http.HttpServletResponse;
23:
24: /**
25: * ViewHandler - View Handler Interface
26: */
27: public interface ViewHandler {
28:
29: /**
30: * Initializes the handler. Since handlers use the singleton pattern this method should only be called
31: * the first time the handler is used.
32: *
33: * @param context ServletContext This may be needed by the handler in order to lookup properties or XML
34: * definition files for rendering pages or handler options.
35: * @throws ViewHandlerException
36: */
37: public void init(ServletContext context)
38: throws ViewHandlerException;
39:
40: /**
41: * Render the page.
42: *
43: * @param name The name of the view.
44: * @param page The source of the view; could be a page, url, etc depending on the type of handler.
45: * @param info An info string attached to this view
46: * @param request The HttpServletRequest object used when requesting this page.
47: * @param response The HttpServletResponse object to be used to present the page.
48: * @throws ViewHandlerException
49: */
50: public void render(String name, String page, String info,
51: String contentType, String encoding,
52: HttpServletRequest request, HttpServletResponse response)
53: throws ViewHandlerException;
54: }
|