阅 读 文 章

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

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



Scope: request
[list]
Method description

getServerSoftware()
server software version (string)
server版本(字符串)

getSnakeletsVersion()
snakelets version (string)
snakelets版本(字符串)

getServerIP()
server IP address (string). Don't use it in an URL, this screws up the virtual hosting feature.
server IP 地址(字符串)。请不要在URL中使用,这将扰乱virtual hosting 。

getServerName()
published server hostname (string). Taken from the current virtualhost that handles the request. Which can be different from the webapp's owning vhost, because of vhost aliasing. This server name is safe to use in URLs, the virtual hosting will work nicely.
server 主机名(字符串)。从当前正在控制request的主机得到主机名。由于vhost混用,可以和webapp自有的主机名称不同。Server名称在URL中是安全。虚拟主机也会正常工作。

getRealServerName()
real (internal) server hostname (string)
真实server 主机名(字符串)

getServerProtocol()
supported HTTP level (string, "HTTP/1.0")
提供HTTP等级(字符串,”HTTP/1.0”)

getServerPort()
socket port of the server (int)
server 的socket 端口(int)

getRequestURL()
the original full request URL (without hostname and port), for example: "/page/test.cgi?arg=34" Use with the getBaseURL method to obtain a complete URL.
原始的请求URL(没有主机名和端口),比如:”/page/test.cgi?arg=34”,和getBaseURL一起使用可以得到完成整的URL.

getRequestURLplain()
like getRequestURL, but also without any query args. Use with the next method (getBaseURL) to obtain a complete URL without query args.
和 getRequestURL差不多,但是不包括询问参数。

getBaseURL()
The base URL of the server. Example: "http://desertfish.xs4all.nl:9080"
得到server 的基本URL ,比如:”http://desertfish.xs4all.n1:9080”

getPathInfo()
any additional URL path components after the snakelet URL. Example: when url is 'snoop.sn/foo/bar?arg=value', it returns "/foo/bar". (Note: this is always empty when you use a fnmatch URL pattern for your snakelet!) (this string is not url-escaped)
任何在snakelet URL后面附加的URL路径组件。比如:当url是’snoop.sn/foo/bar?arg=value’,将返回”/foo/bar”。(注意,当您使用URL匹配符号的时候返回是空!)(字符串不是 url-escaped)
论坛热门帖子: [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):国外编程技术书籍,中文编程手册,经典编程文章,交流技术,技术软件下载,计算机论文,毕业论文.