01: package org.ztemplates.web.impl;
02:
03: import javax.servlet.ServletContext;
04: import javax.servlet.http.HttpServletRequest;
05: import javax.servlet.http.HttpServletResponse;
06:
07: import org.ztemplates.web.ZIServiceRepository;
08:
09: public class ZServiceContext {
10: private final ServletContext servletContext;
11:
12: private final HttpServletRequest request;
13:
14: private final HttpServletResponse response;
15:
16: private final ZIServiceRepository serviceRepository;
17:
18: public ZServiceContext(ZIServiceRepository serviceRepository,
19: HttpServletRequest request, HttpServletResponse response) {
20: this .serviceRepository = serviceRepository;
21: this .servletContext = request.getSession().getServletContext();
22: this .request = request;
23: this .response = response;
24: }
25:
26: public ServletContext getServletContext() {
27: return servletContext;
28: }
29:
30: public HttpServletRequest getRequest() {
31: return request;
32: }
33:
34: public HttpServletResponse getResponse() {
35: return response;
36: }
37:
38: public ZIServiceRepository getServiceRepository() {
39: return serviceRepository;
40: }
41: }
|