Reading request parameters in Google App Engine with Java
Question: I'm modifying the default project that Eclipse creates when you create a new
project with Google Web Toolkit and Google App Engine. It is the
GreetingService sample project.

How can I read a request parameter in the client's .java file?

For example, the current URL is
`http://127.0.0.1:8887/MyProj.html?gwt.codesvr=127.0.0.1&foo=bar` and I want
to use something like `request.getParameter("foo") == "bar"`.

I saw that the documentation mentions the
[Request](http://code.google.com/appengine/docs/python/tools/webapp/requestclass.html)
class for Python, but I couldn't find the equivalent for Java. It's listed as
being in the `google.appengine.ext.webapp` package, but if I try importing
that into my .java file (with a `com.` prefix), it says that it can't resolve
the `ext` part.


Answer: [Google App
Engine](http://code.google.com/appengine/docs/java/runtime.html#Requests_and_Servlets)
uses the [Java Servlet
API](http://download.oracle.com/javaee/1.4/api/javax/servlet/Servlet.html).

GWT's [RemoteServiceServlet](http://google-web-
toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/server/rpc/RemoteServiceServlet.html)
provides access to the request through:

`[HttpServletRequest](http://download.oracle.com/javaee/1.4/api/javax/servlet/http/HttpServletRequest.html)
request = this.getThreadLocalRequest();`

from which you can call either `request.getQueryString()`, and interpret the
query string any way you desire, or you can call `request.getParameter("foo")`

