阅 读 文 章

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

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


共享的 modules/libraries:将您想要共享的 module/packages 放到该目录下,Starting and Configuring中有比较详细的描述。


[size=18]Create pages for the web application[/size]

Let's say that you have created a web application "testapp" and that it has a "docroot" directory where you will put your page files, so you must point the docroot attribute to it in the webapp's init file, as described above. The files in that directory will now be accessible in your browser by using the url base: http://server.com/testapp/
加入您创建了一个web应用程序”testapp”,在此目录中有一个 “docroot”目录用来仿制您的页面文件,您必须在webapp的 init文件中指定docroot属性,就像我们先前描述的。该文件将不能通过url访问:http://server.com/testapp/

Snakelets maps the rest of the URL to the filesystem (=the contents of the docroot directory) in a rather straightforward way, much the same as a normal web server such as Apache does this. A path component in the url maps to a directory on disk, and a file component usually maps to a file on disk. So that means that when the url http://server.com/testapp/office/page.html is requested, Snakelets will return the "page.html" file from the "office" directory in the docroot location. For Ypages it is the same, http://server.com/testapp/office/login.y will cause Snakelets to load and run the "login.y" ypage in the given location. 
Snakelets 直接将URL映射到系统文件(=docroot 目录的内容),跟Apache一样。每一个路径组成部分都映射到硬盘上的某一个文件夹,文件映射到硬盘上的文件。所以,当 http://server.com/testapp/office/page.html被请求的时候,Snakelets将从docroot的office目录返回 ‘page.html’文件。对于Ypage也是同样。

It is impossible to request files outside the docroot location this way. That is nice, because you can protect your other files (web app source code and such) very easily just by placing them in a different directory as your web pages. You could fool around with the documentAllower function but this is more convenient and faster.
论坛热门帖子: [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):国外编程技术书籍,中文编程手册,经典编程文章,交流技术,技术软件下载,计算机论文,毕业论文.