2 // (C) 2007 Mainsoft Corporation (http://www.mainsoft.com)
\r
3 // Author: Konstantin Triger <kostat@mainsoft.com>
\r
7 // Permission is hereby granted, free of charge, to any person obtaining
\r
8 // a copy of this software and associated documentation files (the
\r
9 // "Software"), to deal in the Software without restriction, including
\r
10 // without limitation the rights to use, copy, modify, merge, publish,
\r
11 // distribute, sublicense, and/or sell copies of the Software, and to
\r
12 // permit persons to whom the Software is furnished to do so, subject to
\r
13 // the following conditions:
\r
15 // The above copyright notice and this permission notice shall be
\r
16 // included in all copies or substantial portions of the Software.
\r
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
19 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
20 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
21 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
\r
22 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
\r
23 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
\r
24 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
28 using System.Collections.Generic;
\r
31 using Mainsoft.Web.Hosting;
\r
32 using javax.servlet;
\r
33 using javax.servlet.http;
\r
35 namespace Mainsoft.Web
\r
38 /// ServletHttpContext contains all of the per-request state information related to the processing of a single request,
\r
39 /// and the rendering of the corresponding response.
\r
41 public sealed class ServletHttpContext : BaseHttpContext
\r
43 internal ServletHttpContext (HttpContext context)
\r
48 /// Gets the Mainsoft.Web.ServletHttpContext object for the current sevlet request.
\r
50 /// <param name="context"></param>
\r
51 /// <returns></returns>
\r
52 public static new ServletHttpContext GetCurrent (HttpContext context) {
\r
53 return BaseHttpContext.GetCurrent (context) as ServletHttpContext;
\r
56 private new ServletWorkerRequest Worker {
\r
57 get { return (ServletWorkerRequest) base.Worker; }
\r
61 /// Returns the current javax.servlet.http.HttpServlet object.
\r
63 public HttpServlet Servlet {
\r
64 get { return Worker.Servlet; }
\r
68 /// Returns the current javax.servlet.http.HttpServletRequest object.
\r
70 public HttpServletRequest ServletRequest {
\r
71 get { return Worker.ServletRequest; }
\r
76 /// Returns the current javax.servlet.http.HttpServletResponse object.
\r
78 public HttpServletResponse ServletResponse {
\r
79 get { return Worker.ServletResponse; }
\r
83 /// Returns the javax.servlet.ServletConfig object for the current sevlet.
\r
85 public ServletConfig ServletConfig {
\r
86 get { return Servlet.getServletConfig (); }
\r
90 /// Returns the javax.servlet.ServletContext object for the current application.
\r
92 public ServletContext ServletContext {
\r
93 get { return Servlet.getServletContext (); }
\r
98 /// Returns the current servlet name.
\r
100 public string ServletName {
\r
102 return Servlet.getServletName ();
\r