01: /*
02: * Copyright 2003-2006 Rick Knowles <winstone-devel at lists sourceforge net>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: */
07: package javax.servlet;
08:
09: import java.util.Enumeration;
10: import java.net.URL;
11: import java.io.InputStream;
12: import java.util.Set;
13:
14: /**
15: * Models the web application concept as an interface.
16: *
17: * @author <a href="mailto:rick_knowles@hotmail.com">Rick Knowles</a>
18: */
19: public interface ServletContext {
20: public Object getAttribute(String name);
21:
22: public Enumeration getAttributeNames();
23:
24: public String getInitParameter(String name);
25:
26: public Enumeration getInitParameterNames();
27:
28: public String getServletContextName();
29:
30: public ServletContext getContext(String uripath);
31:
32: public String getServerInfo();
33:
34: public String getMimeType(String file);
35:
36: public int getMajorVersion();
37:
38: public int getMinorVersion();
39:
40: public RequestDispatcher getRequestDispatcher(String path);
41:
42: public RequestDispatcher getNamedDispatcher(String name);
43:
44: public String getRealPath(String path);
45:
46: public URL getResource(String path)
47: throws java.net.MalformedURLException;
48:
49: public InputStream getResourceAsStream(String path);
50:
51: public Set getResourcePaths(String path);
52:
53: public String getContextPath();
54:
55: /**
56: * @deprecated As of Java Servlet API 2.1, with no direct replacement.
57: */
58: public Servlet getServlet(String name) throws ServletException;
59:
60: /**
61: * @deprecated As of Java Servlet API 2.1, with no replacement.
62: */
63: public Enumeration getServletNames();
64:
65: /**
66: * @deprecated As of Java Servlet API 2.0, with no replacement.
67: */
68: public Enumeration getServlets();
69:
70: /**
71: * @deprecated As of Java Servlet API 2.1, use log(String message, Throwable
72: * throwable) instead.
73: */
74: public void log(Exception exception, String msg);
75:
76: public void log(String msg);
77:
78: public void log(String message, Throwable throwable);
79:
80: public void removeAttribute(String name);
81:
82: public void setAttribute(String name, Object object);
83: }
|