liftweb作者David关于SiteMap,URL Rewriting, URL Dispatching的讲解
Folks,
lift services HTTP requests in a "render pipeline".
lift is implemented as a Filter (thanks to the excellent suggestion from
Viktor).
When a request comes in, any functions defined in LiftRules.early (see
LiftRules.appendEarly) as executed. This can be used to set Tomcat to UTF-8(jetty也可以)
for parameter parsing (although this is dangerous if lift is one of many
Filters and the other Filters expect different behavior).
When a request comes in, the request re-writing is repeatedly applied to the
request until there are no more matches in the request re-writer partial
function.
The re-written request is then used to create a RequestState instance.
Next, the filter tests the request against LiftRules.isLiftRequest_? to see
if there's a specific rule about the request being handled by lift.
If the request should be handled by lift, the request is passed to an
instance of LiftServlet.
The request is matched against LiftRules.statelessDispatchTable and serviced
if there's a match (this is useful for REST requests that are truly
stateless and there's no desire to create a new Servlet Session for each
request.)
All of the subsequent handlers are done inside the "S" context (thus, they
have access to session state):
If the request matches LiftRules.dispatchTable, then the request is handled
by dispatchTable.
If the request is a Comet request, it's handled by the Comet handler.
If the request is an Ajax request, it's handled by the Ajax handler.
Otherwise, the request is handed off the the LiftSession for further
processing.
In the LiftSession, the request is tested against session specific
dispatchers (see S.highlevelSessionDispatcher) and dispatched if there's a
match.
Next, the request is tested against SiteMap (if SiteMap is defined). If the
page is guarded by SiteMap and the guard fails, then the appropriate
response is sent to the browser.
Otherwise, the template for the incoming request is located.
First, the LiftRules.templateTable is consulted (this is a method which
combines session specific template lookup with LiftRules-based template
lookup.) If the template is located, it's returned.
Otherwise, the parts of the path that start with '.', '_' or contain
'-hidden' are removed and the resource is looked up in
LiftSession.findAnyTemplate.
findAnyTemplate looks for a given named resource (given suffixes and
locales). If the resource cannot be located, a class and method are
searched for in the "valid packages".view packages.
Once the template is located, it is processed by processSurroundAndInclude.
Questions?
Thanks,
David
分享到:
相关推荐
Programmatically Setting Control Adapters for URL Rewriting and AJAX。
URL Rewriting in ASP.NET1.1 C#
URLRewriting 页面静态化.实现表态化用的,下载后直安装后直接用就OK了.
分析如何使用微软提供的ASP.NET来对动态产生的URL地址进行网址重写。 网址重写是实现一种截取网址请求并将其进行处理后重新指向到一个指定的网址的过程。作者本人在对各种实现网址重写的技术进行研究和探讨后得出的...
URLRewriting 重定向 URLRewriting 重定向
URL Rewriting in ASP.NET
URLRewriting 重写 使用说明。如果你不想让别人看到你动态网页的直接路径时,就用它。
尝试依葫芦画瓢写了自己的一个UrlRewriting。本人资源分比较低,就希望各位支持了。 一、参数 1、Enabled:bool值,设置是否应用Url重写功能; 2、IsUseCache:bool,设置是否启用Cache功能;(写该功能...
看 看 吧 ,很 不 错 的 东 东 !
分析如何使用微软提供的ASP.NET来对动态产生的URL地址进行网址重写。 网址重写是实现一种截取网址请求并将其进行处理后重新指向到一个指定的网址的过程。作者本人在对各种实现网址重写的技术进行研究和探讨后得出的...
分析如何使用微软提供的ASP.NET来对动态产生的URL地址进行网址重写。 网址重写是实现一种截取网址请求并将其进行处理后重新指向到一个指定的网址的过程。作者本人在对各种实现网址重写的技术进行研究和探讨后得出的...
分析如何使用微软提供的ASP.NET来对动态产生的URL地址进行网址重写。 网址重写是实现一种截取网址请求并将其进行处理后重新指向到一个指定的网址的过程。作者本人在对各种实现网址重写的技术进行研究和探讨后得出的...
分析如何使用微软提供的ASP.NET来对动态产生的URL地址进行网址重写。 网址重写是实现一种截取网址请求并将其进行处理后重新指向到一个指定的网址的过程。作者本人在对各种实现网址重写的技术进行研究和探讨后得出的...
分析如何使用微软提供的ASP.NET来对动态产生的URL地址进行网址重写。 网址重写是实现一种截取网址请求并将其进行处理后重新指向到一个指定的网址的过程。作者本人在对各种实现网址重写的技术进行研究和探讨后得出的...
DotBBS 开源论坛 由ASP.NET+Access架构而成,当然也可以和MSSQL搭配,程序中使用有第三方的组件,像CuteEditor以及URL重写组件UrlRewriting.dll等。这个论坛界面挺清新,如上图示,功能可以满足中小型网站使用,Ajax...
在 ASP.NET 中执行 URL 重写
前面有2篇帖子提到了关于URL Routing的特性,但是发现有很多人误会URL Routing就是URl Rewriting,其实2个虽然都提供相似的功能(提高友好的URL方便搜索引起收录),但是2者的原理和运行周期是完全不一样的,本篇...
LNCS 2009-6 Rewriting Techniques and Applications