01: // Copyright (c) 2001 Per M.A. Bothner and Brainfood Inc.
02: // This is free software; for terms and warranty disclaimer see ./COPYING.
03:
04: package gnu.kawa.servlet;
05:
06: import javax.servlet.*;
07: import javax.servlet.http.*;
08: import gnu.mapping.*;
09:
10: public class ServletCallContext extends CallContext {
11: public HttpServletRequest request;
12: public HttpServletResponse response;
13: public HttpServlet servlet;
14:
15: static ServletCallContext getServletCallContext() {
16: return (ServletCallContext) CallContext.getOnlyInstance();
17: }
18:
19: public static HttpServletRequest getRequest() {
20: return getServletCallContext().request;
21: }
22:
23: public static HttpServletResponse getResponse() {
24: return getServletCallContext().response;
25: }
26:
27: public static HttpServlet getServlet() {
28: return getServletCallContext().servlet;
29: }
30:
31: public static ServletConfig getServletConfig() {
32: return getServletCallContext().servlet.getServletConfig();
33: }
34:
35: public static ServletContext getServletContext() {
36: return getServletCallContext().servlet.getServletConfig()
37: .getServletContext();
38: }
39: }
|