开发者

Grasshopper framework: does it support specifying handler in web.config?

开发者 https://www.devze.com 2023-01-11 09:21 出处:网络
I was trying to port an ASP.NET web application to run on Tomcat using MainSoft Grasshopper framework. My application takes advantage of custom HTTP handlers. Here\'s how I use them right now:

I was trying to port an ASP.NET web application to run on Tomcat using MainSoft Grasshopper framework. My application takes advantage of custom HTTP handlers. Here's how I use them right now:

web.config:

...
<system.web>
    <httpHandlers>
        <add verb="*" path="*.xyz" type="App1.XyzHandler" validate="false"/>
...

XyzHandler.cs:

...
namespace App1 {
开发者_如何学C    public class XyzHandler : IHttpHandler {
        public bool IsReusable { get { return true; } }
        public void ProcessRequest(HttpContext context) {
            context.Response.ContentType = "text/plain";
            context.Response.Write("Xyz OK");
        }
    }
}

In ASP.NET, this makes it so, that when you load http:/xxxxxxx/xxxx/anything.xyz , the IIS will load XyzHandler class and pass request to ProcessRequest method. File anything.xyz doesn't have to even exist. Is there some way to get this feature working on J2EE with grasshopper?

Sorry, if this is a noob question, I'm very new to this grasshopper product

0

精彩评论

暂无评论...
验证码 换一张
取 消