简体   繁体   English

.NET相当于Java Servlet过滤器

[英].NET equivalent of Java Servlet Filters

是否有一个.NET等效于使用Servlet筛选器进行.NET中的请求预处理?

您应该创建一个HttpModule并处理HttpApplication事件(可能是BeginRequest )。

ASP.NET MVC provides just such a filter API, along with a set of out-of-the-box filters for validation, authorization, and other common pre- or post-processing needs. ASP.NET MVC提供了这样的筛选器API,以及一组用于验证,授权和其他常见的预处理或后处理需求的即用型筛选器。 Here is an introductory tutorial: 这是一个入门教程:

http://www.asp.net/mvc/tutorials/understanding-action-filters-cs http://www.asp.net/mvc/tutorials/understanding-action-filters-cs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM