google-app-enginegroovyjettygaelyk

How to get the actual URI on Google App Engine?


I'm using Gaelyk 0.7 with GAE 1.5, and I'm attempting to get the request URI in controllers/views:

${request.uri}

That works fine locally, however org.mortbay.jetty.Request.getUri() does not seem supported in production.
When I reach /some/path I expect to get '/some/path' as URI, but ${request.requestURI} gives me something like '/index.groovy'.

Is there any workaround for this?


Solution

  • The servlet API method for getting the request URI is getRequestURI(), indeed not Jetty's specific getUri(), so it's better to use the former than the later. As for the path returned, I'm not sure you can get the real path you see in the browser, and instead get the real path that's used after the redirect or forward -- but I'm not 100% sure here.

    Also, don't hesitate to join the Gaelyk Google Group instead, as I don't monitor stackoverflow for Gaelyk support.

    Edit: in Gaelyk 1.0, you can do request.originalURI to get the real path before the redirect or forward.