# Thursday, March 13, 2003

HttpHandlers And The IIS Metabase

HttpHandlers and the IIS Metabase.

Our team has recently consolidated a bunch of intranet sites housed on various team members' machines into subwebs on a larger server.  I had been hosting one of the sites from my office, and needed a way to redirect all hyperlinks to that particular subweb to a new subweb without affecting the rest of the sites on the machine.  ASP.NET provides a rather simple way of doing this:

using System.Web;

namespace Forward {
  public class Forwarder : IHttpHandler
    {

    public Forwarder(){}

    public void ProcessRequest(HttpContext context)
      {

      string subWeb = "http://mymachine/subweb";
      string oldWeb = "http://newmachine/newsubweb";

      HttpRequest request = context.Request;
      HttpResponse response = context.Response;
     
      string newUrl = request.Url.AbsoluteUri.Replace(subWeb,newWeb);
      response.Redirect(newUrl);
      }

    public bool IsReusable
      {
      get { return false; }
      }
    }
  }

compiled as forward.dll and placed in the subweb's bin/ directory, with the following added to the Web.config:

<httpHandlers>
         <add verb="*" path="*" type="Forward.Forwarder, Forward" />
</httpHandlers>

Funny enough, this only worked for paths like http://mymachine/subweb/foo.aspx, since paths like http://mymachine/subweb/foo.htm were routed directly to the filesystem by IIS and bypassed ASP.NET.  I remembered having this problem before, when .NET was still in development, and the trick was to associate the "*" file extension with ASP.NET in the script map.  Too bad IIS no longer stores the script map in the registry where it's easy to mess with.

A bit of searching and I found:

http://support.microsoft.com/default.aspx?scid=KB;en-us;q232068#3

I just had to use MetaEdit to find LM/W3SVC/1/ROOT/ScriptMaps and add:

*,C:\WINDOWS\Microsoft.NET\Framework\v1.2.x86dbg\aspnet_isapi.dll,1

and everything is working great now. [Better Living Through Software]

#    Comments [0] |

More HttpHandlers Richard Birkby P

More HttpHandlers.

Richard Birkby pointed me to his URL rewriting code, similar to Apache's mod_rewrite.  It's a clever piece of code, and also works with the metabase hack I described (to get * mapped rather than .* or .).  The comments in the article led me to an ISAPI rewriter, and a rather creative hack that involves overriding the behavior of the 404 redirect page.

My little handler is working fine, but I could have saved myself a bunch of time by checking CodeProject.com first.

[Better Living Through Software]
#    Comments [0] |

Another Alternative To XForms Is Xopusnbsp Last Time I Looked This Was Interesting But Bugg

Another alternative to XForms is Xopus - last time I looked this was interesting but buggy, but that was a while ago. As I said to someone a couple of days ago, the problem these days is not defining what the problem is, or what the desired outcomes are, its deciding what tools to apply to acheive the outcomes. It was all sooo much easier when it was a choice between Apple II + Apple Basic or CPM + MBasic.

#    Comments [0] |

Simple MarkupA

Simple markup. I'm currently looking into textile for inspiration.[Sam Ruby]

Interesting little thing, there are times when dialogs etc are very cumbersome and a little bit of markup is much easier to use.

#    Comments [0] |

SPAN StyleFONTSIZE 9pt FONTFAMILY Verdana

.. since my group does (.NET) System.XML, maybe I can provide some more insight.  ... More managed apps, and more client UI.  Currently about 99% of all desktop apps are native code.  We want to see that number be closer to zero.  This alone is going to put a ton of pressure on teams to do a better job of componentizing their libraries.  [Better Living Through Software]

As the tiger would say "how delightful".

#    Comments [0] |

SPAN Class23

The Blog Explorer now has category and date views, and a pseudo-aggregator....  You can see this by clicking the Explorer link on the top right of pages on the blog web siteUsing an Explorer Bar (in this case the Search Pane) kind of gets you the best of a frameset, without the drawbacks (document titles, synchronization, etc).  [Blog Curioso] This is really cool. Maybe I can do something similar and enable posting/re-posting from it? [ScottW's ASP.NET WebLog]

The use of _search or _media as the target of window.open() is not something we directly support in the ZPX browser control - the question is should (can!) we?

#    Comments [0] |

Itnbspwould Appear That If You Want An Internet Server That Does EverythingnbspA Hrefhttpwwwopenlinkswcomvirtuoso

It would appear that if you want an Internet server that does everything, OpenLink's Virtuoso is a candidate to add to the list.
#    Comments [0] |

The CommentAPI The Easiest Way To Explain It Is That Yo

The CommentAPI. The easiest way to explain it is that you can post a comment via posting an RSS item fragment. [Sam Ruby]

Simpe and elegant for a simple facility - much better than the complexities of SOAP/XML-RPC for such a simple service.

#    Comments [0] |
# Monday, March 10, 2003

Seriously Damned Fine DHTML Oddpostnbsp Go To The Demo Not Surprisingly A Couple Of Th

Seriously damned fine DHTML: Oddpost - go to the demo, not surprisingly a couple of the people were at halfbrain.com.
#    Comments [0] |

Clemens Vasters Has Some Interesting Observations On InfoPathA

Clemens Vasters has some interesting observations on InfoPath that indicate that it might well be suitable for forming a part of a survey infrastructure. The (maybe better) alternative i XForms which has the 'merit' of being a standard, just not implemented by anyone and apparently not implemented by InfoPath. One could add XForms support to IE/Zeepe as namespace behaviours - it has already been done by FormsPlayer (IE 6 SP1 only - why?).
#    Comments [0] |