But how can GWT parse the GET request parameters?
or how to solve this kind of problem?
Look into History and HistoryListener. When your page is loaded, any history
token after a # will be automatically handed to your app. So your URLs will
look like xxxx.html#1, xxxx.html#2, etc.
--
┌── dg@cowlark.com ─── http://www.cowlark.com ───────────────────
│
│ "There does not now, nor will there ever, exist a programming language in
│ which it is the least bit hard to write bad programs." --- Flon's Axiom
If you host your GWT module in a JSP page, you can use normal JSP code
to grab the parameter -- request.getParameter("foo"). This mainly
works well for initial or startup parameters.
You can then stick the parameter into a JavaScript structure and
access the structure through the GWT Dictionary class. You could
generically add them all in a loop, too.
Example JSP code:
<body>
<%
String foo = request.getParameter("foo");
if (foo == null || foo.trim().length() == 0) {
foo = "default";
}
%>
<script language="javascript">
var parameters = {
foo: "<%=foo%>"
};
</script>
<script language="javascript" src="my.gwt.Module.nocache.js"></
script>
</body>
Example Java code:
Dictionary parameters = Dictionary.getDictionary("parameters");
String foo = parameters.get("foo");