Author: kostat
Date: 2007-11-20 02:45:38 -0500 (Tue, 20 Nov 2007)
New Revision: 89966

Added:
   
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletWorkerRequest.cs
Modified:
   
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseHttpServlet.cs
   
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseStaticHttpServlet.cs
   
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/OutputStreamWrapper.cs
   
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletWorkerRequest.jvm.cs
   branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.J2EE.csproj
   
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/ServletAuthenticationModule.cs
   
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionIDManager.cs
   
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionStateItemCollection.cs
   
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionStateStoreProvider.cs
   branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web/J2EEConsts.cs
   branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web/J2EEUtils.cs
Log:
refactoring for portal integration

Modified: 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web/J2EEConsts.cs
===================================================================
--- branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web/J2EEConsts.cs     
2007-11-20 07:16:43 UTC (rev 89965)
+++ branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web/J2EEConsts.cs     
2007-11-20 07:45:38 UTC (rev 89966)
@@ -27,7 +27,7 @@
 
 namespace Mainsoft.Web
 {
-       internal static class J2EEConsts
+       public static class J2EEConsts
        {
                public const string SESSION_STATE = "GH_SESSION_STATE";
 

Modified: branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web/J2EEUtils.cs
===================================================================
--- branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web/J2EEUtils.cs      
2007-11-20 07:16:43 UTC (rev 89965)
+++ branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web/J2EEUtils.cs      
2007-11-20 07:45:38 UTC (rev 89966)
@@ -37,28 +37,28 @@
 {
        internal static class J2EEUtils
        {
-               public static string GetInitParameterByHierarchy(ServletConfig 
config, string name)
-               {
-                       if (config == null)
-                               throw new ArgumentNullException("config");
+               //public static string 
GetInitParameterByHierarchy(ServletConfig config, string name)
+               //{
+               //    if (config == null)
+               //        throw new ArgumentNullException("config");
 
-                       string value = config.getInitParameter(name);
-                       if (value != null)
-                               return value;
+               //    string value = config.getInitParameter(name);
+               //    if (value != null)
+               //        return value;
 
-                       return 
config.getServletContext().getInitParameter(name);
-               }
+               //    return config.getServletContext().getInitParameter(name);
+               //}
 
-               public static string GetApplicationRealPath (ServletConfig 
config) {
-                       return GetApplicationRealPath (config, "/");
+               public static string GetApplicationRealPath (ServletContext 
context) {
+                       return GetApplicationRealPath (context, "/");
                }
 
-               public static string GetApplicationRealPath (ServletConfig 
config, string appVirtualPath)
+               public static string GetApplicationRealPath (ServletContext 
context, string appVirtualPath)
                {
-                       string realFs = GetInitParameterByHierarchy (config, 
J2EEConsts.FILESYSTEM_ACCESS);
+                       string realFs = context.getInitParameter 
(J2EEConsts.FILESYSTEM_ACCESS);
                        if (realFs == null || realFs == J2EEConsts.ACCESS_FULL) 
{
                                try {
-                                       string realPath = 
config.getServletContext ().getRealPath (appVirtualPath);
+                                       string realPath = context.getRealPath 
(appVirtualPath);
                                        if (!String.IsNullOrEmpty (realPath)) {
                                                if (!String.IsNullOrEmpty 
(appVirtualPath) &&
                                                        appVirtualPath 
[appVirtualPath.Length - 1] == '/')
@@ -77,11 +77,10 @@
                        return IAppDomainConfig.WAR_ROOT_SYMBOL + 
appVirtualPath;
                }
 
-               public static string GetApplicationPhysicalPath (ServletConfig 
config) {
+               public static string GetApplicationPhysicalPath (ServletContext 
context) {
                        string path = String.Empty;
 
-                       ServletContext context = config.getServletContext ();
-                       string appDir = GetInitParameterByHierarchy (config, 
IAppDomainConfig.APP_DIR_NAME);
+                       string appDir = 
context.getInitParameter(IAppDomainConfig.APP_DIR_NAME);
                        if (appDir != null) {
                                try {
                                        if (Directory.Exists(appDir))
@@ -95,14 +94,14 @@
                                }
                        }
                        if (path.Length == 0)
-                               path = GetApplicationRealPath (config);
+                               path = GetApplicationRealPath (context);
 
                        return path;
                }
 
-               static internal ServletWorkerRequest GetWorkerRequest 
(HttpContext context) {
+               static internal BaseWorkerRequest GetWorkerRequest (HttpContext 
context) {
                        IServiceProvider sp = (IServiceProvider) context;
-                       return (ServletWorkerRequest) sp.GetService (typeof 
(HttpWorkerRequest));
+                       return (BaseWorkerRequest) sp.GetService (typeof 
(HttpWorkerRequest));
                }
        }
 }

Modified: 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseHttpServlet.cs
===================================================================
--- 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseHttpServlet.cs
        2007-11-20 07:16:43 UTC (rev 89965)
+++ 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseHttpServlet.cs
        2007-11-20 07:45:38 UTC (rev 89966)
@@ -49,9 +49,9 @@
        public class BaseHttpServlet : HttpServlet
        {
                //private AppDomain _servletDomain;
-               static readonly LocalDataStoreSlot _servletRequestSlot = 
Thread.GetNamedDataSlot(J2EEConsts.SERVLET_REQUEST);
-               static readonly LocalDataStoreSlot _servletResponseSlot = 
Thread.GetNamedDataSlot(J2EEConsts.SERVLET_RESPONSE);
-               static readonly LocalDataStoreSlot _servletSlot = 
Thread.GetNamedDataSlot(J2EEConsts.CURRENT_SERVLET);
+               //static readonly LocalDataStoreSlot _servletRequestSlot = 
Thread.GetNamedDataSlot(J2EEConsts.SERVLET_REQUEST);
+               //static readonly LocalDataStoreSlot _servletResponseSlot = 
Thread.GetNamedDataSlot(J2EEConsts.SERVLET_RESPONSE);
+               //static readonly LocalDataStoreSlot _servletSlot = 
Thread.GetNamedDataSlot(J2EEConsts.CURRENT_SERVLET);
 
                bool _appVirDirInited = false;
 
@@ -62,73 +62,46 @@
                override public void init(ServletConfig config)
                {
                        base.init(config);
-                       InitServlet(config);
-                       
+                       InitRuntime (config, this, GetDeserializer (), 
getDriverUtils ());
                }
 
-               protected virtual void InitServlet(ServletConfig config)
-               {
-                       if 
(config.getServletContext().getAttribute(J2EEConsts.APP_DOMAIN) != null)
-                               return;
+               public static void InitRuntime (ServletConfig config, object 
evidence,
+                       [EMAIL PROTECTED] deserializer, [EMAIL PROTECTED] 
driverUtils) {
+                       AppDomain servletDomain = createServletDomain (config);
+                       // Mordechai : setting the web app deserializer object.
+                       servletDomain.SetData (J2EEConsts.DESERIALIZER_CONST, 
deserializer);
+                       servletDomain.SetData ([EMAIL PROTECTED], driverUtils);
+                       [EMAIL PROTECTED] (servletDomain);
 
-                       try 
-                       {
-                               AppDomain servletDomain = 
createServletDomain(config);
-                               [EMAIL PROTECTED](servletDomain);
-
+                       try {
+                               ServletContext context = 
config.getServletContext ();
                                //GH Infromation Initizalization
-                               int nowInt = 
DateTime.Now.ToString().GetHashCode();
-                               servletDomain.SetData(".domainId", 
nowInt.ToString("x"));
-                               nowInt += "/".GetHashCode ();
-                               servletDomain.SetData(".appId", 
nowInt.ToString("x"));
-                               servletDomain.SetData(".appName", 
nowInt.ToString("x"));
+                               long currentTime = 
java.lang.System.currentTimeMillis ();
+                               servletDomain.SetData (".domainId", 
currentTime.ToString ("x"));
+                               currentTime = ~currentTime;
+                               servletDomain.SetData (".appId", 
currentTime.ToString ("x"));
+                               servletDomain.SetData (".appName", 
context.getServletContextName ());
 
-                               servletDomain.SetData(J2EEConsts.CLASS_LOADER, 
vmw.common.TypeUtils.ToClass(this).getClassLoader());
-                               
servletDomain.SetData(J2EEConsts.SERVLET_CONFIG, config);
-                               
servletDomain.SetData(J2EEConsts.RESOURCE_LOADER, new [EMAIL 
PROTECTED](config.getServletContext()));
+                               servletDomain.SetData (J2EEConsts.CLASS_LOADER, 
vmw.common.TypeUtils.ToClass (evidence).getClassLoader ());
+                               
//servletDomain.SetData(J2EEConsts.SERVLET_CONFIG, config);
+                               servletDomain.SetData 
(J2EEConsts.RESOURCE_LOADER, new [EMAIL PROTECTED] (context));
 
-                               
config.getServletContext().setAttribute(J2EEConsts.APP_DOMAIN, servletDomain);
-                               config.getServletContext ().setAttribute 
(J2EEConsts.CURRENT_SERVLET, this);
+                               lock (evidence) {
+                                       if (context.getAttribute 
(J2EEConsts.APP_DOMAIN) == null)
+                                               context.setAttribute 
(J2EEConsts.APP_DOMAIN, servletDomain);
+                               }
+                               //config.getServletContext ().setAttribute 
(J2EEConsts.CURRENT_SERVLET, this);
                        }
-                       finally 
-                       {
-                               [EMAIL PROTECTED]();
-                               [EMAIL PROTECTED]();
+                       finally {
+                               [EMAIL PROTECTED] ();
+                               [EMAIL PROTECTED] ();
                        }
                }
 
                protected override void service (HttpServletRequest req, 
HttpServletResponse resp)
                {
-                       const string assemblies = "/assemblies";
-                       const string getping = "getping";
-                       const string setping = "setping";
-                       string servletPath = req.getServletPath ();
+                       resp.setContentType ("text/html");
 
-                       if (String.CompareOrdinal (assemblies, 0, servletPath, 
0, assemblies.Length) == 0) {
-                               if (servletPath.Length == assemblies.Length ||
-                                       servletPath [assemblies.Length] == '/') 
{
-                                       string requestURI = req.getRequestURI 
();
-                                       bool getp = requestURI.EndsWith 
(getping, StringComparison.Ordinal);
-                                       if (!getp && requestURI.EndsWith 
(setping, StringComparison.Ordinal)) {
-                                               getServletContext 
().setAttribute (getping, "1");
-                                               getp = true;
-                                       }
-
-                                       if (getp) {
-                                               string ping = (string) 
getServletContext ().getAttribute (getping);
-                                               if (ping == null)
-                                                       ping = "0";
-                                               resp.getOutputStream ().print 
(ping);
-                                               return;
-                                       }
-                               }
-                       }
-                       resp.setContentType("text/html");
-                       service(req, resp, false);
-               }
-
-               public virtual void service(HttpServletRequest req, 
HttpServletResponse resp, bool alwaysUsePrintWriter)
-               {
                        try 
                        {
                                // Very important - to update Virtual Path!!!
@@ -143,16 +116,16 @@
                                [EMAIL PROTECTED](servletDomain);
 
                                // put request to the TLS
-                               Thread.SetData(_servletRequestSlot, req);
-                               // put response to the TLS
-                               Thread.SetData(_servletResponseSlot, resp);
-                               // put the servlet object to the TLS
-                               Thread.SetData(_servletSlot, this);
+                               //Thread.SetData(_servletRequestSlot, req);
+                               //// put response to the TLS
+                               //Thread.SetData(_servletResponseSlot, resp);
+                               //// put the servlet object to the TLS
+                               //Thread.SetData(_servletSlot, this);
 
                                resp.setHeader("X-Powered-By", "ASP.NET");
                                resp.setHeader("X-AspNet-Version", "1.1.4322");
 
-                               HttpWorkerRequest gwr = new 
ServletWorkerRequest (this, req, resp, alwaysUsePrintWriter);
+                               HttpWorkerRequest gwr = new 
ServletWorkerRequest (this, req, resp);
                                CultureInfo culture = (CultureInfo) [EMAIL 
PROTECTED] (req.getLocale ());
                                Thread currentTread = Thread.CurrentThread;
                                currentTread.CurrentCulture = culture;
@@ -162,9 +135,9 @@
                        finally 
                        {
                                HttpContext.Current = null;
-                               Thread.SetData(_servletRequestSlot, null);
-                               Thread.SetData(_servletResponseSlot, null);
-                               Thread.SetData(_servletSlot, null);
+                               //Thread.SetData(_servletRequestSlot, null);
+                               //Thread.SetData(_servletResponseSlot, null);
+                               //Thread.SetData(_servletSlot, null);
                                [EMAIL PROTECTED]();
                        }
                }
@@ -172,37 +145,38 @@
                override public void destroy()
                {
                        base.destroy();
-                       AppDomain servletDomain = (AppDomain) getServletContext 
().getAttribute (J2EEConsts.APP_DOMAIN);
+                       DestroyRuntime (getServletContext (), this);
+               }
+
+               public static void DestroyRuntime (ServletContext context, 
object evidence) {
+                       AppDomain servletDomain = (AppDomain) 
context.getAttribute (J2EEConsts.APP_DOMAIN);
                        if (servletDomain == null)
                                return;
 
-                       try 
-                       {
-                               [EMAIL PROTECTED](servletDomain);
+                       try {
+                               [EMAIL PROTECTED] (servletDomain);
 #if DEBUG
-                               Console.WriteLine("Destroy of GhHttpServlet");
+                               Console.WriteLine ("Destroy of GhHttpServlet");
 #endif
-                               HttpRuntime.Close();
-                               [EMAIL PROTECTED](this);
-                               
this.getServletContext().removeAttribute(J2EEConsts.APP_DOMAIN);
-                               
java.lang.Thread.currentThread().setContextClassLoader(null);
+                               HttpRuntime.Close ();
+                               [EMAIL PROTECTED] (evidence);
+                               context.removeAttribute (J2EEConsts.APP_DOMAIN);
+                               java.lang.Thread.currentThread 
().setContextClassLoader (null);
                        }
-                       catch(Exception e) 
-                       {
+                       catch (Exception e) {
 #if DEBUG
-                               Console.WriteLine("ERROR in Servlet Destroy 
{0},{1}",e.GetType(), e.Message);
-                               Console.WriteLine(e.StackTrace);
+                               Console.WriteLine ("ERROR in Servlet Destroy 
{0},{1}", e.GetType (), e.Message);
+                               Console.WriteLine (e.StackTrace);
 #endif
                        }
-                       finally
-                       {
-                               [EMAIL PROTECTED]();
+                       finally {
+                               [EMAIL PROTECTED] ();
                        }
                }
 
-               private AppDomain createServletDomain(ServletConfig config)
+               private static AppDomain createServletDomain(ServletConfig 
config)
                {
-                               string rootPath = 
J2EEUtils.GetApplicationRealPath(config);
+                               string rootPath = 
J2EEUtils.GetApplicationRealPath(config.getServletContext ());
                                AppDomainSetup domainSetup = new 
AppDomainSetup();
                                string name = 
config.getServletName();//.getServletContextName();
                                if (name == null)
@@ -220,11 +194,11 @@
                                
//servletDomain.SetData(IAppDomainConfig.APP_PHYS_DIR, 
J2EEUtils.GetApplicationPhysicalPath(config));
                                
//servletDomain.SetData(IAppDomainConfig.WEB_APP_DIR, rootPath);
 
-                               
servletDomain.SetData(IAppDomainConfig.APP_PHYS_DIR, 
J2EEUtils.GetApplicationPhysicalPath(config));
+                               
servletDomain.SetData(IAppDomainConfig.APP_PHYS_DIR, 
J2EEUtils.GetApplicationPhysicalPath(config.getServletContext ()));
                                
servletDomain.SetData(IAppDomainConfig.WEB_APP_DIR, rootPath);
 
                                //Set DataDirectory substitution string 
(http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx)
-                               string dataDirectory = 
J2EEUtils.GetInitParameterByHierarchy(config, "DataDirectory");
+                               string dataDirectory = config.getServletContext 
().getInitParameter ("DataDirectory");
                                if (dataDirectory == null)
                                        dataDirectory = "App_Data";
 
@@ -268,9 +242,6 @@
 #if DEBUG
                                Console.WriteLine("Initialization of webapp " + 
webApp_baseDir);
 #endif
-                               // Mordechai : setting the web app deserializer 
object.
-                               
servletDomain.SetData(J2EEConsts.DESERIALIZER_CONST , this.GetDeserializer());
-                               servletDomain.SetData([EMAIL PROTECTED], 
this.getDriverUtils());
                                //servletDomain.SetData(".hostingVirtualPath", 
"/");
                                //servletDomain.SetData(".hostingInstallDir", 
"/");
                                return servletDomain;
@@ -278,12 +249,9 @@
        
                virtual protected [EMAIL PROTECTED] GetDeserializer()
                {
-                       if (m_deseializer == null)
-                               m_deseializer = new GHWebDeseserializer();
-                       return m_deseializer;
+                       return new GHWebDeseserializer ();
                }
 
-               protected [EMAIL PROTECTED] m_deseializer = null;
                /// Mordechai: This class comes to solve a problem in class 
deserialize
                /// within web application. The problem is that the classloader 
that created 
                /// some user web class (for example aspx page) is not the 
class loader

Modified: 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseStaticHttpServlet.cs
===================================================================
--- 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseStaticHttpServlet.cs
  2007-11-20 07:16:43 UTC (rev 89965)
+++ 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseStaticHttpServlet.cs
  2007-11-20 07:45:38 UTC (rev 89966)
@@ -47,7 +47,7 @@
                override public void init(ServletConfig config)
                {
                        base.init(config);
-                       AppDir = J2EEUtils.GetInitParameterByHierarchy(config, 
IAppDomainConfig.APP_DIR_NAME);
+                       AppDir = config.getServletContext ().getInitParameter 
(IAppDomainConfig.APP_DIR_NAME);
                        if (AppDir != null) {
                                AppDir = AppDir.Replace('\\', '/');
                                if (AppDir[AppDir.Length - 1] != '/')

Modified: 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/OutputStreamWrapper.cs
===================================================================
--- 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/OutputStreamWrapper.cs
    2007-11-20 07:16:43 UTC (rev 89965)
+++ 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/OutputStreamWrapper.cs
    2007-11-20 07:45:38 UTC (rev 89966)
@@ -41,7 +41,7 @@
        /// <summary>
        /// 
        /// </summary>
-       internal sealed class OutputStreamWrapper : java.io.Writer
+       public sealed class OutputStreamWrapper : java.io.Writer
        {
                enum OutputMode
                {
@@ -53,9 +53,9 @@
                readonly OutputStream _outputStream;
                readonly OutputMode _outputMode;
 
-               private byte [] _bytebuffer = new byte [1024];
-               private char [] _charBuffer = new char [1024];
-               sbyte [] _oneByte = new sbyte [1];
+               private byte [] _bytebuffer;
+               private char [] _charBuffer;
+               //sbyte [] _oneByte = new sbyte [1];
 
                Encoding _encoding = null;
 
@@ -144,12 +144,15 @@
                private char [] GetCharBuffer (int length)
                {
                        // We will reuse the buffer if its size is < 32K
-                       if (_charBuffer.Length >= length)
+                       if (_charBuffer != null && _charBuffer.Length >= length)
                                return _charBuffer;
 
                        if (length > 32 * 1024)
                                return new char [length];
 
+                       if (length < 1024)
+                               length = 1024;
+
                        _charBuffer = new char [length];
                        return _charBuffer;
                }
@@ -157,12 +160,15 @@
                private byte [] GetByteBuffer (int length)
                {
                        // We will reuse the buffer if its size is < 32K
-                       if (_bytebuffer.Length >= length)
+                       if (_bytebuffer != null && _bytebuffer.Length >= length)
                                return _bytebuffer;
 
                        if (length > 32 * 1024)
                                return new byte [length];
 
+                       if (length < 1024)
+                               length = 1024;
+
                        _bytebuffer = new byte [length];
                        return _bytebuffer;
                }

Added: 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletWorkerRequest.cs
===================================================================
--- 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletWorkerRequest.cs
   2007-11-20 07:16:43 UTC (rev 89965)
+++ 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletWorkerRequest.cs
   2007-11-20 07:45:38 UTC (rev 89966)
@@ -0,0 +1,196 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using javax.servlet.http;
+using java.security;
+
+namespace Mainsoft.Web.Hosting
+{
+       sealed class ServletWorkerRequest : BaseWorkerRequest
+       {
+               readonly HttpServlet _HttpServlet;
+               readonly HttpServletRequest _HttpServletRequest;
+               readonly HttpServletResponse _HttpServletResponse;
+
+               public ServletWorkerRequest (HttpServlet servlet, 
HttpServletRequest req, HttpServletResponse resp)
+                       : base (req.getContextPath(), req.getServletPath (), 
req.getRequestURI ()) {
+
+                       _HttpServlet = servlet;
+                       _HttpServletRequest = req;
+                       _HttpServletResponse = resp;
+
+               }
+
+               static readonly Type typeOfHttpServletRequest = typeof 
(HttpServletRequest);
+               static readonly Type typeOfHttpServletResponse = typeof 
(HttpServletResponse);
+               static readonly Type typeOfHttpServlet = typeof (HttpServlet);
+               static readonly Type typeOfHttpSession = typeof (HttpSession);
+               public override object GetService (Type serviceType) {
+                       if (serviceType == typeOfHttpServlet)
+                               return _HttpServlet;
+                       if (serviceType == typeOfHttpServletRequest)
+                               return _HttpServletRequest;
+                       if (serviceType == typeOfHttpServletResponse)
+                               return _HttpServletResponse;
+                       if (serviceType == typeOfHttpSession)
+                               return GetSession (false);
+                       return base.GetService (serviceType);
+               }
+
+               //public HttpServlet Servlet {
+               //    get {
+               //        return _HttpServlet;
+               //    }
+               //}
+
+               //public HttpServletRequest ServletRequest {
+               //    get {
+               //        return _HttpServletRequest;
+               //    }
+               //}
+
+               //public HttpServletResponse ServletResponse {
+               //    get {
+               //        return _HttpServletResponse;
+               //    }
+               //}
+
+               public override string GetHttpVerbName () {
+                       return _HttpServletRequest.getMethod ();
+               }
+
+               public override string GetHttpVersion () {
+                       return _HttpServletRequest.getProtocol ();
+               }
+
+               public override string GetLocalAddress () {
+                       return _HttpServletRequest.getLocalAddr ();
+               }
+
+               public override int GetLocalPort () {
+                       return _HttpServletRequest.getServerPort ();
+               }
+
+               public override string GetPathInfo () {
+                       string pathInfo = base.GetPathInfo() ?? 
_HttpServletRequest.getPathInfo ();
+                       return pathInfo ?? String.Empty;
+               }
+
+               public override string GetQueryString () {
+                       return _HttpServletRequest.getQueryString ();
+               }
+
+               public override string GetRemoteAddress () {
+                       return _HttpServletRequest.getRemoteAddr ();
+               }
+
+               public override string GetRemoteName () {
+                       return _HttpServletRequest.getRemoteHost ();
+               }
+
+
+               public override int GetRemotePort () {
+                       try {
+                               return _HttpServletRequest.getRemotePort ();
+                       }
+                       catch (Exception e) {
+                               // if servlet API is 2.3 and below - there is 
no method getRemotePort 
+                               // in ServletRequest interface... should be 
described as limitation.
+                               return 0;
+                       }
+               }
+
+               public override string GetProtocol () {
+                       return _HttpServletRequest.getScheme ();
+               }
+
+               public override string GetServerName () {
+                       return _HttpServletRequest.getServerName ();
+               }
+
+               public override bool IsSecure () {
+                       return _HttpServletRequest.isSecure ();
+               }
+
+               public override void SendStatus (int statusCode, string 
statusDescription) {
+                       // setStatus(int, string) is deprecated
+                       _HttpServletResponse.setStatus (statusCode/*, 
statusDescription*/);
+               }
+
+               public override void SendUnknownResponseHeader (string name, 
string value) {
+                       if (HeadersSent ())
+                               return;
+
+                       _HttpServletResponse.addHeader (name, value);
+               }
+
+               public override bool HeadersSent () {
+                       return _HttpServletResponse.isCommitted ();
+               }
+
+               public override void SendCalculatedContentLength (int 
contentLength) {
+                       _HttpServletResponse.setContentLength (contentLength);
+               }
+
+               public override string GetAuthType () {
+                       return _HttpServletRequest.getAuthType ();
+               }
+
+               protected override int getContentLength () {
+                       return _HttpServletRequest.getContentLength ();
+               }
+
+               protected override string getContentType () {
+                       return _HttpServletRequest.getContentType ();
+               }
+
+               public override string GetRemoteUser () {
+                       return _HttpServletRequest.getRemoteUser ();
+               }
+
+               protected override int getServerPort () {
+                       return _HttpServletRequest.getServerPort ();
+               }
+
+               protected override java.util.Enumeration getHeaderNames () {
+                       return _HttpServletRequest.getHeaderNames ();
+               }
+
+               protected override string getHeader (string name) {
+                       return _HttpServletRequest.getHeader (name);
+               }
+
+               protected override java.io.InputStream getInputStream () {
+                       return _HttpServletRequest.getInputStream ();
+               }
+
+               public override javax.servlet.ServletContext GetContext () {
+                       return _HttpServlet.getServletContext ();
+               }
+
+               protected override OutputStreamWrapper CreateOutputStream (bool 
binary) {
+                       return binary ?
+                               new OutputStreamWrapper 
(_HttpServletResponse.getOutputStream ()) :
+                               new OutputStreamWrapper 
(_HttpServletResponse.getWriter ());
+               }
+
+               public override HttpSession GetSession (bool create) {
+                       return _HttpServletRequest.getSession (create);
+               }
+
+               public override bool IsRequestedSessionIdValid () {
+                       return _HttpServletRequest.isRequestedSessionIdValid ();
+               }
+               public override string GetRequestedSessionId () {
+                       return _HttpServletRequest.getRequestedSessionId ();
+               }
+
+               public override bool IsUserInRole (string name) {
+                       return _HttpServletRequest.isUserInRole (name);
+               }
+
+               public override Principal GetUserPrincipal () {
+                       return _HttpServletRequest.getUserPrincipal ();
+               }
+       }
+}

Modified: 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletWorkerRequest.jvm.cs
===================================================================
--- 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletWorkerRequest.jvm.cs
       2007-11-20 07:16:43 UTC (rev 89965)
+++ 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletWorkerRequest.jvm.cs
       2007-11-20 07:45:38 UTC (rev 89966)
@@ -38,16 +38,15 @@
 using vmw.common;
 using [EMAIL PROTECTED];
 using InputStream=java.io.InputStream;
+using java.security;
 
 namespace Mainsoft.Web.Hosting {
        [MonoTODO("Implement security demands on the path usage functions (and 
review)")]
        [ComVisible (false)]
-       internal sealed class ServletWorkerRequest : HttpWorkerRequest, 
IServiceProvider {
-               readonly HttpServlet _HttpServlet;
-               readonly HttpServletRequest _HttpServletRequest;
-               readonly HttpServletResponse _HttpServletResponse;
+       public abstract class BaseWorkerRequest : HttpWorkerRequest, 
IServiceProvider {
                OutputStreamWrapper _OutputStream;
 
+               readonly string _contextPath;
                readonly string _requestUri;
                readonly string _pathInfo;
 
@@ -79,7 +78,7 @@
 
                static readonly Hashtable KnownServerVariableMap;
 
-               static ServletWorkerRequest() {
+               static BaseWorkerRequest() {
                        _srvVarsToHeaderMap = new StringDictionary();
                        _srvVarsToHeaderMap.Add("HTTP_ACCEPT", "Accept");
                        _srvVarsToHeaderMap.Add("HTTP_REFERER", "Referer");
@@ -96,17 +95,14 @@
                                
KnownServerVariableMap[knownServerVariableNames[i]] = (KnownServerVariable)i;
                }
 
-               public ServletWorkerRequest (HttpServlet servlet, 
HttpServletRequest req, HttpServletResponse resp, bool alwaysUsePrintWriter) {
-                       _HttpServlet = servlet;
-                       _HttpServletRequest = req;
-                       _HttpServletResponse = resp;
+               public BaseWorkerRequest (string contextPath, string 
servletPath, string requestURI) {
 
-                       if (alwaysUsePrintWriter)
-                               _OutputStream = CreateOutputStream (false);
 
-                       string contextPath = req.getContextPath();
-                       string servletPath = req.getServletPath ();
-                       string requestURI = req.getRequestURI ();
+                       _contextPath = contextPath;
+
+                       //string contextPath = req.getContextPath();
+                       //string servletPath = req.getServletPath ();
+                       //string requestURI = req.getRequestURI ();
                        // servletPath - Returns the part of this request's URL 
that calls the servlet.
                        //              so it contains default page.
                        // requestURI - Returns the part of this request's URL 
from the protocol name up to the query string in the first line of the HTTP 
request.
@@ -145,37 +141,14 @@
                        }
                }
 
-               public object GetService (Type serviceType)
+               static readonly Type typeOfWriter = typeof (java.io.Writer);
+               public virtual object GetService (Type serviceType)
                {
-                       if (serviceType == typeof(HttpServlet))
-                               return Servlet;
-                       if (serviceType == typeof(HttpServletRequest))
-                               return ServletRequest;
-                       if (serviceType == typeof(HttpServletResponse))
-                               return ServletResponse;
-                       if (serviceType == typeof (java.io.Writer))
+                       if (serviceType == typeOfWriter)
                                return CreateOutputStream (false);
                        return null;
                }
-
-               public HttpServlet Servlet {
-                       get {
-                               return _HttpServlet;
-                       }
-               }
                
-               public HttpServletRequest ServletRequest {
-                       get{
-                               return _HttpServletRequest;
-                       }
-               }
-
-               public HttpServletResponse ServletResponse {
-                       get{
-                               return _HttpServletResponse;
-                       }
-               }
-               
                [MonoTODO("Implement security")]
                public override string MachineInstallDirectory {
                        get {
@@ -194,8 +167,11 @@
                }
 
                public override void FlushResponse (bool finalFlush) {
-                       IPortletActionResponse resp =_HttpServletResponse as 
IPortletActionResponse;
-                       if (_OutputStream == null || resp != null && 
resp.isRedirected())
+                       //kostat
+                       //IPortletActionResponse resp =_HttpServletResponse as 
IPortletActionResponse;
+                       //if (_OutputStream == null || resp != null && 
resp.isRedirected())
+                       //      return;
+                       if (_OutputStream == null)
                                return;
 
                        _OutputStream.flush();
@@ -204,11 +180,8 @@
                }
 
                public override string GetAppPath () {
-                       return _HttpServletRequest.getContextPath();
+                       return _contextPath;
                }
-               public override string GetAppPathTranslated () {
-                       return 
J2EEUtils.GetApplicationRealPath(_HttpServlet.getServletConfig());;
-               }
 
                public override string GetFilePath () {
                        string uri = GetUriPath();
@@ -231,31 +204,10 @@
                        return Path.Combine (GetAppPathTranslated (), page);
                }
 
-               public override string GetHttpVerbName () {
-                       return _HttpServletRequest.getMethod();
-               }
-
-               public override string GetHttpVersion () {
-                       return _HttpServletRequest.getProtocol();
-               }
-
-               public override string GetLocalAddress () {
-                       return _HttpServletRequest.getLocalAddr();
-               }
-
-               public override int GetLocalPort () {
-                       return _HttpServletRequest.getServerPort();
-               }
-
                public override string GetPathInfo () {
-                       string pathInfo = _pathInfo != null ? _pathInfo : 
_HttpServletRequest.getPathInfo();
-                       return pathInfo != null ? pathInfo : String.Empty;
-               }
+                       return _pathInfo;
+               }               
 
-               public override string GetQueryString () {
-                       return _HttpServletRequest.getQueryString();
-               }
-
                public override string GetRawUrl () {
                        if (_rawUrl == null) {
                                StringBuilder builder = new StringBuilder();
@@ -273,26 +225,6 @@
                        return _rawUrl;
                }
 
-               public override string GetRemoteAddress() {
-                       return _HttpServletRequest.getRemoteAddr();
-               }
-
-               public override string GetRemoteName() {
-                       return _HttpServletRequest.getRemoteHost();
-               }
-
-
-               public override int GetRemotePort() {
-                       try {
-                               return _HttpServletRequest.getRemotePort();
-                       }
-                       catch(Exception e) {
-                               // if servlet API is 2.3 and below - there is 
no method getRemotePort 
-                // in ServletRequest interface... should be described as 
limitation.
-                               return 0;
-                       }
-               }
-
                public override string GetServerVariable(string name) {
                        // FIXME: We need to make a proper mapping between the 
standard server
                        // variables and java equivalent. probably we have to 
have a configuration file 
@@ -302,31 +234,48 @@
                        string headerName = _srvVarsToHeaderMap[name];
 
                        if (headerName != null)
-                               return _HttpServletRequest.getHeader( 
headerName );
+                               return getHeader( headerName );
 
                        object knownVariable = KnownServerVariableMap[name];
                        if (knownVariable != null)
                                return 
GetKnownServerVariable((KnownServerVariable)knownVariable);
 
-                       return _HttpServletRequest.getHeader( name );
+                       return getHeader( name );
                }
 
+               public abstract string GetAuthType ();
+               protected abstract int getContentLength ();
+               protected abstract string getContentType ();
+               public abstract string GetRemoteUser ();
+               protected abstract int getServerPort ();
+               protected abstract string getHeader (string name);
+               protected abstract java.util.Enumeration getHeaderNames ();
+               protected abstract InputStream getInputStream ();
+               public abstract ServletContext GetContext ();
+               protected abstract OutputStreamWrapper CreateOutputStream (bool 
binary);
+
+               public abstract HttpSession GetSession (bool create);
+               public abstract bool IsRequestedSessionIdValid ();
+               public abstract string GetRequestedSessionId ();
+               public abstract bool IsUserInRole (string name);
+               public abstract Principal GetUserPrincipal ();
+
                string GetKnownServerVariable(KnownServerVariable index) {
                        switch (index) {
-                               case KnownServerVariable.AUTH_TYPE : return 
_HttpServletRequest.getAuthType();
-                               case KnownServerVariable.CONTENT_LENGTH : 
return Convert.ToString(_HttpServletRequest.getContentLength());
-                               case KnownServerVariable.CONTENT_TYPE : return 
_HttpServletRequest.getContentType();
+                               case KnownServerVariable.AUTH_TYPE : return 
GetAuthType();
+                               case KnownServerVariable.CONTENT_LENGTH : 
return Convert.ToString(getContentLength());
+                               case KnownServerVariable.CONTENT_TYPE : return 
getContentType();
                                case KnownServerVariable.QUERY_STRING : return 
GetQueryString();
                                case KnownServerVariable.REMOTE_ADDR : return 
GetRemoteAddress();
                                case KnownServerVariable.REMOTE_HOST : return 
GetRemoteName();
-                               case KnownServerVariable.REMOTE_USER : return 
_HttpServletRequest.getRemoteUser();
+                               case KnownServerVariable.REMOTE_USER : return 
GetRemoteUser();
                                case KnownServerVariable.REQUEST_METHOD : 
return GetHttpVerbName ();
                                case KnownServerVariable.REQUEST_URI : return 
GetUriPath();
                                case KnownServerVariable.SCRIPT_NAME : return 
GetFilePath ();
                                case KnownServerVariable.SERVER_NAME : return 
GetServerName();
-                               case KnownServerVariable.SERVER_PORT : return 
Convert.ToString(_HttpServletRequest.getServerPort());
+                               case KnownServerVariable.SERVER_PORT : return 
Convert.ToString(getServerPort());
                                case KnownServerVariable.SERVER_PROTOCOL : 
return GetHttpVersion ();
-                               case KnownServerVariable.SERVER_SOFTWARE : 
return Servlet.getServletContext().getServerInfo();
+                               case KnownServerVariable.SERVER_SOFTWARE : 
return GetContext().getServerInfo();
                                case KnownServerVariable.PATH_INFO : return 
GetPathInfo();
                                default: throw new 
IndexOutOfRangeException("index");
                        }
@@ -340,11 +289,15 @@
                        return IntPtr.Zero;
                }
 
+               public override string GetAppPathTranslated () {
+                       return J2EEUtils.GetApplicationRealPath (GetContext ());
+               }
+
                public override string MapPath (string virtualPath) {
                        if (virtualPath == null)
                                throw new ArgumentNullException ("virtualPath");
 
-                       ServletConfig config = _HttpServlet.getServletConfig 
();                        
+                       ServletContext context = GetContext ();
 
                        string contextPath = GetAppPath ();
                        if ((virtualPath.Length > contextPath.Length && 
virtualPath [contextPath.Length] != '/') ||
@@ -354,11 +307,11 @@
                                        appVirtualPathIndex = 
virtualPath.IndexOf ('/', appVirtualPathIndex + 1);
                                        string crossContextPath = 
appVirtualPathIndex > 0 ?
                                                virtualPath.Remove 
(appVirtualPathIndex) : virtualPath;
-                                       ServletContext context = 
config.getServletContext ().getContext (crossContextPath);
-                                       if (context != null) {
+                                       ServletContext other = 
context.getContext (crossContextPath);
+                                       if (other != null) {
                                                string appVirtualPath = 
appVirtualPathIndex > 0 ?
                                                        virtualPath.Substring 
(appVirtualPathIndex) : String.Empty;
-                                               return context.getRealPath 
(appVirtualPath);
+                                               return other.getRealPath 
(appVirtualPath);
                                        }
                                }
 
@@ -368,7 +321,7 @@
                        }
 
                        string thisAppVirtualPath = virtualPath.Length > 
contextPath.Length ? virtualPath.Substring (contextPath.Length) : String.Empty;
-                       return J2EEUtils.GetApplicationRealPath (config, 
thisAppVirtualPath);
+                       return J2EEUtils.GetApplicationRealPath (context, 
thisAppVirtualPath);
 
                }
 
@@ -392,24 +345,25 @@
                        }
                }
 
-               private OutputStreamWrapper CreateOutputStream (bool binary)
-               {
-                       IPortletActionResponse resp = _HttpServletResponse as 
IPortletActionResponse;
-                       if (resp != null)
-                               return null; // no output stream while 
processAction
+               //kostat
+               //private OutputStreamWrapper CreateOutputStream (bool binary)
+               //{
+               //    IPortletActionResponse resp = _HttpServletResponse as 
IPortletActionResponse;
+               //    if (resp != null)
+               //        return null; // no output stream while processAction
 
-                       if (_OutputStream != null)
-                               return _OutputStream;
+               //    if (_OutputStream != null)
+               //        return _OutputStream;
 
-                       if (_HttpServletResponse != null) {
-                               if (binary)
-                                       _OutputStream = new OutputStreamWrapper 
(_HttpServletResponse.getOutputStream ());
-                               else
-                                       _OutputStream = new OutputStreamWrapper 
(_HttpServletResponse.getWriter ());
-                       }
+               //    if (_HttpServletResponse != null) {
+               //        if (binary)
+               //            _OutputStream = new OutputStreamWrapper 
(_HttpServletResponse.getOutputStream ());
+               //        else
+               //            _OutputStream = new OutputStreamWrapper 
(_HttpServletResponse.getWriter ());
+               //    }
 
-                       return _OutputStream;
-               }
+               //    return _OutputStream;
+               //}
 
                public override void SendResponseFromMemory (byte [] data, int 
length) {
                        _OutputStream = CreateOutputStream (true);
@@ -421,26 +375,6 @@
                        _OutputStream.write(sdata, 0 , length);
                }
 
-               public override void SendStatus(int statusCode, string 
statusDescription) {
-                       // setStatus(int, string) is deprecated
-                       _HttpServletResponse.setStatus(statusCode/*, 
statusDescription*/);
-               }
-
-               public override void SendUnknownResponseHeader(string name, 
string value) {
-                       if (HeadersSent ())
-                               return;
-
-                       _HttpServletResponse.addHeader(name, value);
-               }
-
-               public override bool HeadersSent () {
-                       return _HttpServletResponse.isCommitted();
-               }
-
-               public override void SendCalculatedContentLength (int 
contentLength) {
-                       _HttpServletResponse.setContentLength(contentLength);
-               }
-
                public override void SendKnownResponseHeader (int index, string 
value) {
                        SendUnknownResponseHeader (GetKnownResponseHeaderName 
(index), value);
                }
@@ -450,18 +384,18 @@
                }
 
                public override string GetUnknownRequestHeader (string name) {
-                       return _HttpServletRequest.getHeader(name);
+                       return getHeader(name);
                }
 
                public override string [][] GetUnknownRequestHeaders () {
                        if (unknownHeaders == null) {
                                ArrayList pairs = new ArrayList ();
-                               for (java.util.Enumeration he = 
_HttpServletRequest.getHeaderNames(); he.hasMoreElements() ;) {
+                               for (java.util.Enumeration he = 
getHeaderNames(); he.hasMoreElements() ;) {
                                        string key = (string) he.nextElement();
                                        int index = 
HttpWorkerRequest.GetKnownRequestHeaderIndex (key);
                                        if (index != -1)
                                                continue;
-                                       pairs.Add (new string [] {key, 
_HttpServletRequest.getHeader(key)});
+                                       pairs.Add (new string [] {key, 
getHeader(key)});
                                }
                                
                                if (pairs.Count != 0) {
@@ -479,29 +413,17 @@
                        if (buffer == null || size == 0)
                                return 0;
                        sbyte [] sbuffer = 
vmw.common.TypeUtils.ToSByteArray(buffer);
-                       InputStream inp = _HttpServletRequest.getInputStream();
-                       if (inp == null && _HttpServletRequest is 
IPortletActionRequest)
-                               inp = ((IPortletActionRequest) 
_HttpServletRequest).getPortletInputStream();
-                       int r = (inp != null) ? inp.read(sbuffer, 0, size) : -1;
-                       return r == -1 ? 0 : r;
+                       InputStream inp = getInputStream();
+                       if (inp == null)
+                               return 0;
+                       int r = inp.read (sbuffer, 0, size);
+                       return r < 0 ? 0 : r;
                }
 
                public override void 
SetEndOfSendNotification(System.Web.HttpWorkerRequest.EndOfSendNotification 
callback, object extraData) {
                        _endOfSendCallback = callback;
                        _endOfSendArgs = extraData;
                }
-
-               public override string GetProtocol() {
-                       return _HttpServletRequest.getScheme();
-               }
-
-               public override string GetServerName() {
-                       return _HttpServletRequest.getServerName();
-               }
-
-               public override bool IsSecure() {
-                       return _HttpServletRequest.isSecure();
-               }
        }
 }
 

Modified: branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.J2EE.csproj
===================================================================
--- branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.J2EE.csproj       
2007-11-20 07:16:43 UTC (rev 89965)
+++ branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.J2EE.csproj       
2007-11-20 07:45:38 UTC (rev 89966)
@@ -143,6 +143,7 @@
     <Compile Include="Mainsoft.Web.Hosting\IncludeHelperServlet.cs" />
     <Compile Include="Mainsoft.Web.Hosting\OutputStreamWrapper.cs" />
     <Compile Include="Mainsoft.Web.Hosting\ServletFacesPageHandlerFactory.cs" 
/>
+    <Compile Include="Mainsoft.Web.Hosting\ServletWorkerRequest.cs" />
     <Compile Include="Mainsoft.Web.Hosting\ServletWorkerRequest.jvm.cs" />
     <Compile Include="Mainsoft.Web.Profile\CloudscapeProfileProvider.cs" />
     <Compile Include="Mainsoft.Web.Profile\DerbyProfileHelper.cs" />

Modified: 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/ServletAuthenticationModule.cs
===================================================================
--- 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/ServletAuthenticationModule.cs
   2007-11-20 07:16:43 UTC (rev 89965)
+++ 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/ServletAuthenticationModule.cs
   2007-11-20 07:45:38 UTC (rev 89966)
@@ -31,6 +31,7 @@
 using System.Web.Util;
 using javax.servlet;
 using javax.servlet.http;
+using Mainsoft.Web.Hosting;
 
 namespace Mainsoft.Web.Security
 {
@@ -49,32 +50,32 @@
 
                void OnAuthenticateRequest (object sender, EventArgs args) {
                        HttpApplication app = (HttpApplication) sender;
-                       HttpServletRequest req = J2EEUtils.GetWorkerRequest 
(app.Context).ServletRequest;
-                       if (req.getRemoteUser () != null)
+                       BaseWorkerRequest req = J2EEUtils.GetWorkerRequest 
(app.Context);
+                       if (req.GetRemoteUser () != null)
                                app.Context.User = new ServletPrincipal (req);
                }
        }
 
        public sealed class ServletPrincipal : IPrincipal
        {
-               readonly HttpServletRequest _request;
+               readonly BaseWorkerRequest _request;
                readonly IIdentity _identity;
 
-               public ServletPrincipal (HttpServletRequest req) {
+               internal ServletPrincipal (BaseWorkerRequest req) {
                        _request = req;
-                       string authType = req.getAuthType ();
+                       string authType = req.GetAuthType ();
                        if (authType == null)
                                authType = String.Empty;
-                       _identity = new GenericIdentity (req.getRemoteUser (), 
authType);
+                       _identity = new GenericIdentity (req.GetRemoteUser (), 
authType);
                }
 
                public bool IsInRole (string role) {
-                       return _request.isUserInRole (role);
+                       return _request.IsUserInRole (role);
                }
 
                public IIdentity Identity { get { return _identity; } }
 
-               public java.security.Principal Principal { get { return 
_request.getUserPrincipal (); } }
+               public java.security.Principal Principal { get { return 
_request.GetUserPrincipal (); } }
        }
 }
 

Modified: 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionIDManager.cs
===================================================================
--- 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionIDManager.cs
   2007-11-20 07:16:43 UTC (rev 89965)
+++ 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionIDManager.cs
   2007-11-20 07:45:38 UTC (rev 89966)
@@ -30,6 +30,7 @@
 using System.Web;
 using System.Web.SessionState;
 using javax.servlet.http;
+using Mainsoft.Web.Hosting;
 
 namespace Mainsoft.Web.SessionState
 {
@@ -45,8 +46,8 @@
                }
 
                public string GetSessionID (HttpContext context) {
-                       HttpServletRequest request = J2EEUtils.GetWorkerRequest 
(context).ServletRequest;
-                       return request.isRequestedSessionIdValid () ? 
request.getRequestedSessionId () : null;
+                       BaseWorkerRequest request = J2EEUtils.GetWorkerRequest 
(context);
+                       return request.IsRequestedSessionIdValid () ? 
request.GetRequestedSessionId () : null;
                }
 
                public void Initialize () {

Modified: 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionStateItemCollection.cs
===================================================================
--- 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionStateItemCollection.cs
 2007-11-20 07:16:43 UTC (rev 89965)
+++ 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionStateItemCollection.cs
 2007-11-20 07:45:38 UTC (rev 89966)
@@ -57,10 +57,8 @@
                                _staticObjects = new 
HttpStaticObjectsCollection ();
 
                                if (context != null) {
-                                       ServletConfig config = 
J2EEUtils.GetWorkerRequest (context).Servlet.getServletConfig ();
-                                       string sessionPersistance = 
J2EEUtils.GetInitParameterByHierarchy(config, 
J2EEConsts.Enable_Session_Persistency);
-                                       if (sessionPersistance == null)
-                                               sessionPersistance = 
config.getServletContext().getInitParameter 
(J2EEConsts.Enable_Session_Persistency);
+                                       ServletContext servletContext = 
J2EEUtils.GetWorkerRequest (context).GetContext ();
+                                       string sessionPersistance = 
servletContext.getInitParameter (J2EEConsts.Enable_Session_Persistency);
                                        if (sessionPersistance != null) {
                                                try {
                                                        _needSessionPersistence 
= Boolean.Parse (sessionPersistance);

Modified: 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionStateStoreProvider.cs
===================================================================
--- 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionStateStoreProvider.cs
  2007-11-20 07:16:43 UTC (rev 89965)
+++ 
branches/mainsoft/JSF/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionStateStoreProvider.cs
  2007-11-20 07:45:38 UTC (rev 89966)
@@ -146,7 +146,7 @@
                }
 
                internal static HttpSession GetSession (HttpContext context, 
bool create, bool throwOnError) {
-                       HttpSession session = J2EEUtils.GetWorkerRequest 
(context).ServletRequest.getSession (create);
+                       HttpSession session = J2EEUtils.GetWorkerRequest 
(context).GetSession (create);
                        if (session == null && throwOnError)
                                throw new HttpException ("Session is not 
established");
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to