Google App Engine中的漂亮网址 [英] Pretty URLs in Google App Engine

查看:118
本文介绍了Google App Engine中的漂亮网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将参数'A1B2C3'传递给基于Google App Engine的GWT应用程序。我喜欢www.example.com/index.html?key=A1B2C3。虽然它工作,我想使用漂亮的网址。是否可以在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

而不是

instead of

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:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆