{"id":471,"date":"2003-08-08T14:24:08","date_gmt":"2003-08-08T18:24:08","guid":{"rendered":"http:\/\/wordpress.cephas.net\/?p=471"},"modified":"2003-08-08T14:24:08","modified_gmt":"2003-08-08T18:24:08","slug":"httphandlers-httpmodules-servlets-filters","status":"publish","type":"post","link":"https:\/\/cephas.net\/blog\/2003\/08\/08\/httphandlers-httpmodules-servlets-filters\/","title":{"rendered":"HttpHandlers, HttpModules, Servlets &amp; Filters"},"content":{"rendered":"<p>I&#8217;m in project limbo today, coming off a <a href=\"http:\/\/www.footjoy.com\/myjoys\/\">large ecommerce initiative<\/a> for <a href=\"http:\/\/www.footjoy.com\/\">FootJoy<\/a> that uses ASP, C#, Flash and Flash Remoting and moving onto another ecommerce site, this one completely C#.  <\/p>\n<p>I&#8217;m slowly <a href=\"http:\/\/dictionary.reference.com\/search?q=grok\">grokking<\/a> the .NET packages, I trying to understand the low-level System.Web classes today.  I was interested to read about the <a href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/cpguide\/html\/cpconhttphandlers.asp\">IHttpHandler<\/a> interface, which you use to create services that are similar in nature to the Java <a href=\"http:\/\/java.sun.com\/webservices\/docs\/ea2\/api\/javax\/servlet\/Servlet.html\">Servlet<\/a> interface. Similarities I can see\/find:  <\/p>\n<ul>\n<li>JSP&#8217;s are compiled down to servlets at runtime, .NET uses the System.Web.UI.PageHandlerFactory class when handling requests for .aspx files.  Don&#8217;t believe me? Check the &lt;httpHandlers&gt; element of your machine.config file.\n<li>Servlets can be configured to respond to a variety endpoints through the &lt;servlet-mapping&gt; element of web.xml, HttpHandlers are added to web.config like this:\n<p>&lt;httpHandlers&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&lt;add verb=&#8221;*&#8221; path=&#8221;\/mypath\/somepage.aspx&#8221; type=&#8221;com.mindseye.handlers.TestHandler, TestHandler&#8221; \/&gt;<br \/>\n&lt;\/httpHandlers&gt;<\/p>\n<li>Both servlets and httphandlers give you a means of interacting with the low-level request and response services of the web server\n<\/ul>\n<p>In much the same way, <a href=\"http:\/\/msdn.microsoft.com\/library\/default.asp?url=\/library\/en-us\/cpguide\/html\/cpconhttpmodules.asp?frame=true\">HttpModules<\/a> and the <a href=\"http:\/\/java.sun.com\/webservices\/docs\/ea2\/api\/javax\/servlet\/Filter.html\">javax.servlet.Filter<\/a> class perform similar functions. An HttpModule class registers itself to listen for events that are fired in your HttpApplication (for instance the &#8216;BeginRequest&#8217; event) and then can perform actions based on the occurrence of those events.  A Filter is a bit different in that it is mapped to the a specific url pattern in web.xml and is then called when a request is made that matches that pattern.  Just like the HttpModule class, it too can then modify the request coming in or the response going back out.<\/p>\n<p>In general, I&#8217;m very impressed by ASP.NET (and thus the .NET framework).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m in project limbo today, coming off a large ecommerce initiative for FootJoy that uses ASP, C#, Flash and Flash Remoting and moving onto another ecommerce site, this one completely C#. I&#8217;m slowly grokking the .NET packages, I trying to understand the low-level System.Web classes today. I was interested to read about the IHttpHandler interface, &hellip; <a href=\"https:\/\/cephas.net\/blog\/2003\/08\/08\/httphandlers-httpmodules-servlets-filters\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">HttpHandlers, HttpModules, Servlets &amp; Filters<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[],"_links":{"self":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/471"}],"collection":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/comments?post=471"}],"version-history":[{"count":0,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/471\/revisions"}],"wp:attachment":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/media?parent=471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/categories?post=471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/tags?post=471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}