ASP.NET —— IIS Server

这两天看了点web Development的面试题,既然有两条路都准备了材料,那就先看用的正在用的.net吧。

先是IIS(Internet Information Service),关于这两个Server的以后再专门写。

IIS 主要跟Windows绑定,这个integration使得DB和OS交接特别迅速,TomCat和Apache特点在于全面OS支持,各有所长。

接着来个问题:What are HttpHandlers and HttpModules in ASP.NET?

首要问题,how does the IIS reacts when a user requests for a particular resource?

1. It looks for the extension of the requested resource file e.g. (.aspx, .ascx etc.). 看后缀
2. It looks for ISAPI extension mapped against this file extension. 马屁ISAPI(Microsoft's Internet Server Application Program Interface)
3. If found a mapping, then pass request to that particular ISAPI extension.交给ISAPI

如下图所示,在到达一个handler之前,有好几个HTTP module会预处理这些所有的文件,如加安全,OutputCache, Session, WindowsAuthentication, FormsAuthentication, RoleManager etc.

现在我们可以回答上面的问题了。

HTTPHandler:
ASP.NET Engine uses HttpHandlers to handle specific requests on the basis of their extensions. ASP.NET Page Handler handles all requests coming for (.aspx) pages. We can define our own custom HttpHandler to handle a specific request with a specific extension, say .jpeg, .gif, or .imran. But there will always be only one handler for a specific request.
HTTPModules:
ASP.NET Engine uses HttpModules to inject some specific functionality alongwith ASP.NET default functionality for all incoming requests regardless of its extensions. There are a number of built-in modules already available in ASP.NET HTTP Pipeline as we discussed earlier. But we can write our own custom HTTP module to perform some additional functionality (for example, URL rewriting or implementing some security mechanism) for all incoming requests.

Referen: http://searchsoa.techtarget.com/answer/What-is-the-difference-between-TomCat-Apache-Web-server-and-IIS-server

http://www.webdevelopmenthelp.net/2014/03/httphandlers-and-httpmodules-in-asp-net.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值