I would like to use XSP or better mod_mono in a .NET project using the IHttpHandler method.
I have the following class (pretty simple:
public class Class1 : IHttpHandler
{
public bool IsReusable
{
get { return false; }
}
public void ProcessRequest(HttpContext context)
{
var result = "<h1>Yeah</h1>";
var bytes = Encoding.UTF8.GetBytes(result);
context.Response.Write(result);
}
}
And the next web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers accessPolicy="Read, Execute, Script">
<add name="Class" path="*" verb="*" type="IISHost.Class1" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
</system.webServer>
<system.web>
<compilation defaultLanguage="c#" />
</system.web>
</configuration>
It works great in IIS. http://127.0.0.1/test/kfdlsa returns "Yes"
In XSP or mod_mono on Apache, I can create index.aspx that parses and runs fine according to the .Net-Framework, but it seems the handler is not included in the mod_mono-Framework.
Uses IHttpHandler, really implemented in Mono, or I have to use a different approach to collect all requests to a specific host and / or virtual directory.