You can retrieve the URI for the HTTP request made for your
application by implementing the
com.itmill.toolkit.terminal.URIHandler
interface. The handler class needs to be registered in the main
window object of your application with
addURIHandler() method. You then get the
URI by implementing the handleURI()
method. The method gets two parameters: a context and a URI
relative to the context. The context is the base URI for your
application.
In IT Mill Toolkit 4.0.x and in some other versions, the
handleURI() is called also for AJAX
requests after the page is loaded. The proper URI is passed
in the first call during the page load, but subsequent calls
have "UIDL/" in the relative path. You can
usually filter the subsequent calls out by ignoring them if
the relative path is "UIDL/".
You can retrieve the parameters passed to your application by
implementing the
com.itmill.toolkit.terminal.ParameterHandler
interface. The handler class needs to be registered in the main
window object of your application with
addParameterHandler() method. You then
get the parameters in the
handleParameters() method. The
parameters are passes as a map from string key to a vector of
string values.
In IT Mill Toolkit 4.0.x and in some other versions, the
handleParameters() is called also
for AJAX requests after the page is loaded. The proper
parameters are passed in the first call during the page load,
but subsequent calls are given a parameter map with only a
repaintAll parameter. You can usually
filter the subsequent calls out by ignoring them if they
contain the repaintAll key.