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连接。
上一页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1617 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 下一页
| 论坛热门帖子: | [lch203] 写得蛮好的linux学习笔记(10-21) [黑马制造] 学习java的30个目标(10-19) [笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19) [udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18) [沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18) |
| TAG标签: | 翻译 文档 使用 可以 页面 URL 如果 文件 webapp 一个 |
注册
个人空间
