samedi 7 mars 2015

Route dynamic URLs to static files in App Engine Java



I have a Java App Engine app and want to route http://ift.tt/1GtPd82; to i.html. For example:



mydomain.com/i/12345 --> i.html

mydomain.com/i/abcde --> i.html


This looks like it is possible to do in app.yaml for Python and app.yaml for Go with something like:



handlers:
- url: /i/(.*)
static_files: i.html


but this handler mapping to static files is NOT mentioned in app.yaml for Java. Instead, there is a separate Static files and resource files section that cannot do url mappings, and the only options to map a url in handlers is to a servlet, jsp, or filter. If I try to map to static_files in a Java app.yaml, I get an Unable to find property 'static_files' error.


The key here is that I want to map a url to a static file that is served as a static file. Why would this be only possible to do in Python and Go, and not in Java?




Aucun commentaire:

Enregistrer un commentaire