Google App Engine 中的漂亮网址 [英] Pretty URLs in Google App Engine
本文介绍了Google App Engine 中的漂亮网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将参数A1B2C3"传递给基于 Google App Engine 的 GWT 应用程序.我喜欢 www.example.com/index.html?key=A1B2C3.虽然它有效,但我想使用漂亮的 URL.是否可以在 Google App Engine 上进行 URL 重写?我不知道怎么做.
I want to pass a parameter 'A1B2C3' to a GWT application based on Google App Engine. I do it like www.example.com/index.html?key=A1B2C3. Although it's working, I'd like to use pretty URLs. Is it possible to do URL rewriting on Google App Engine? I couldn't find out how.
www.example.com/A1B2C3
代替
www.example.com/index.html?key=A1B2C3
我正在使用 Google App Engine 和 GWT.全部使用 Java.
I'm using Google App Engine and GWT. All in Java.
推荐答案
这是一个很酷的问题.我也想出了如何为 python 做这件事.
This is a cool question. I figured out how to do it for python as well.
app.yaml:
- url: /test/(.*)
script: test.py 1
test.py:
#!/usr/bin/env python
import sys
def main():
for arg in sys.argv:
print arg
if __name__ == '__main__':
main()
这篇关于Google App Engine 中的漂亮网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文