web.config中的处理程序上的path属性的含义 [英] Meaning of path attribute on handlers in web.config

查看:151
本文介绍了web.config中的处理程序上的path属性的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看IIS7.5配置(system.webServer/处理程序).

I'm looking at IIS7.5 configuration (system.webServer/handlers).

您知道处理程序的path参数中的\*.\*之间的区别是什么吗? 您可以使用file.*(匹配file.txt和file.xml)还是abc.a?c(匹配abc.abc和abc.asc)?

Do you know what is the diference between \*. and \* in the path argument for handlers? Could you use file.* (to match file.txt and file.xml) or abc.a?c (to match abc.abc and abc.asc) ?

path参数可以引用文件夹"吗?像\*\f4\*.txt?

Can the path argument make reference to the "folder"? like \*\f4\*.txt?

给出类似http的请求

Given a http request like

    GET \f1\f2.f3\f4\a.b.c?arg1.arg2.arg3=3&arg4.txt=1.4

path参数尝试匹配的部分是什么?

what is the part the path argument tries to match?

推荐答案

从匹配URL中的某些模式的意义上来说,**.路径并不是真正的通配符"映射.

The * and *. paths aren't really "wildcard" mappings in the sense of matching some pattern in your URL.

*处理程序处理对与站点的HTTP处理程序中已指定的任何路径(或动词/前提条件)不匹配的所有内容的请求. HTTP处理程序列表实际上是一个有序列表,如果按路径排序,则IIS7的MMC中的默认视图可能会误导您.要查看真实的处理顺序,应单击右侧操作"窗格中的"*查看订购清单"链接.

The * handler handles requests for all content that doesn't match any paths (or verbs/preconditions) already specified in the HTTP handlers for the site. The HTTP handler list is actually an ordered list, the default view in IIS7's MMC can be misleading if you sort by path. To see the true processing order you should click on the *View Ordered List" link in the right hand side Actions Pane.

执行此操作时,您会看到*处理程序排在最后,并称为StaticFile处理程序.可能还有其他一些内容,例如TRACEVerbHandlerOPTIONSVerbHandler,它们仅响应TRACEOPTIONS动词,您通常可以忽略它们,因为它们不是在正常操作下执行的.

When you do this you'll see that the * handler comes last and is called the StaticFile handler. There may be some others such as the TRACEVerbHandler and the OPTIONSVerbHandler which only respond to the TRACE and OPTIONS verbs which you can generally ignore as they are not executed under normal operation.

*.处理程序特定于ASP.NET 4.0,并且在安装ASP.NET 4.0时添加.该处理程序在那里提供对无扩展名URL的支持.最初,此处理程序不执行任何操作,仅在安装 KB980368修补程序(也已滚动)时才起作用Windows 2008R2/Windows 7 Service Pack 1).

The *. handler is specific to ASP.NET 4.0 and is added when you install ASP.NET 4.0. This handler is there to provide support for extensionless URLs. Initially this handler does nothing and only comes into play when you install the KB980368 hotfix (which is also rolled into Windows 2008R2/Windows 7 Service Pack 1).

Thomas Marquardt 关于*.处理程序和无扩展名的几篇精彩文章网址:

There's a couple of great articles by Thomas Marquardt about the *. handler and extensionless urls:

How ASP.NET MVC Routing Works and its Impact on the Performance of Static Requests
How Extensionless URLs Are Handled By ASP.NET v4

这些文章最初有很多内容需要吸收,您可能需要重新审视IIS7管道的基础知识,才能深入了解它们(花了我几读才能使材料沉入其中),但请坚持使用

There's quite a lot to absorb initially in those articles and you may need to revisit the fundamentals of the IIS7 pipeline to get your head around them (it took me a few reads for the material to sink in), but stick with it.

这篇关于web.config中的处理程序上的path属性的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆