I suggest you use GWT MVP . Suppose your URL is like
http: //www.myPageName/myproject.html? #orderId: 99999
And in your AppController.java -
Try it like
...... public final void onValueChange(final ValueChangeEvent<String> event) { String token = event.getValue(); if (token != null) { String[] tokens = History.getToken().split(":"); final String token1 = tokens[0]; final String token2 = tokens.length > 1 ? tokens[1] : ""; if (token1.equals("orderId") && tonken2.length > 0) { Long orderId = Long.parseLong(token2);
Alternatively, you can also use Spring MVC . Here is an example ...
// Below is in your view.java or presenter.java Window.open(GWT.getHostPageBaseURL() + "customer/order/balance.html?&orderId=99999", "_self", "enable"); // Below code in in your serverside controller.java @Controller @RequestMapping("/customer") public class ServletController { @RequestMapping(value = "/order/balance.html", method = RequestMethod.GET) public void downloadAuctionWonExcel(@RequestParam(value = "orderId", required = true) final String orderId, final HttpServletResponse res) throws Exception { try { System.out.println("Order Id is "+orderId); // more of your service codes } catch (Exception ex) { ex.printStackTrace(); } } }
Cataclysm Jan 29 '14 at 9:23 2014-01-29 09:23
source share