阅 读 文 章

snakelets 文档,我翻译了一部分。

[来源:网上转载 (http://www.chinaunix.net) | 作者:网友(瘦青蛙) | 时间:2007-05-27 | 浏览:人次 ]


To avoid conflicts with other snakelets, it is required that the url pattern for your index snakelet(s) explicitly ends in 'index.sn'. 
Note that you can create 'fake' directories using index Snakelets; the directory that you use in the snakelet url path pattern doesn't have to exist on disk - in contrast to regular index pages.
Snakelet 作为index page:如果没有找到匹配的页面,server就会尝试使用snakelet 作为索引页面。您必须对snakelet的url标记进行设置才能正常使用此功能。 Server会自动在请求路径中寻找 index.sn ,但是这需要您明确的指出:使用标记 index.sn 。为了避免冲突,url标记必须以 ‘index.sn’结尾。注意 您可以使用index Snakelets创建一个“冒牌”的目录;这个目录并不一定在硬盘上存在 --- 同正规页面有鲜明的对比。


[size=18]Smart Suffix Search [/size]

Snakelets also uses a 'smart suffix search'. This means that it is not strictly required to have the correct file suffix in the URL. This allows for 'cleaner' URLs. If a page is not found, Snakelets will try again by -internally- appending the .y, .html and .htm suffixes (in that order). For instance, http://server.com/testapp/office/login.y will load the "login.y" Ypage, but so will http://server.com/testapp/office/login (the same url but without the .y suffix). Notice that dynamic content has higher priority than static content, so if "login.y" and "login.html" both exist, the server will use "login.y". This mechanism is rather useful when you are setting up a website: you can start with all static .html pages, and replace them later on with dynamic .y pages - without changing any of your URLs. 
Snakelets 使用了 ‘ smart suffix search ‘。就是说在URL中的文件后缀不一定严格准确。这允许使用 ‘cleaner’ URL。如果页面没有找到,Snakelets将逐个搜索 .y, .html 和 .htm 后缀。比如 http://server.com/testapp/office/login.y 将载入 ‘login.y’页面,同样将搜索除 .y 后缀以外的 http://server.com/testapp/office/login文件。注意动态内容比静态内容有更高的优先级,当 ‘login.y’ 和 ‘login.html’同时存在时,server将优先使用 ‘login.y’。这种机制是很有用的:您可以先使用静态.html页面,之后用动态 .y 页面代替 --- 而不用修改任何URL连接。
论坛热门帖子: [lch203] 写得蛮好的linux学习笔记(10-21)
[黑马制造] 学习java的30个目标(10-19)
[笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19)
[udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18)
[沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18)
TAG标签: 翻译 文档 使用 可以 页面 URL 如果 文件 webapp 一个

最新评论 共有1位网友发表了评论

发表评论

评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名:(注册)
密码:
验证码:
匿名发表

网站地图友情连接交流论坛网站投稿广告服务联系我们留言本站长统计
Some rights reserved: www.chmhome.com, 鄂ICP备07010232号 E-mail:chinakafei@live.com,QQ:552766
中国咖啡技术网(Chmhome):国外编程技术书籍,中文编程手册,经典编程文章,交流技术,技术软件下载,计算机论文,毕业论文.