gwt

How to prevent DoubleSubmit in a GWT application?

雨燕双飞 提交于 2019-12-19 03:36:37
问题 To clarify what double submit is: When the user clicks on a submit button twice, the server will process the same POST data twice. To avoid this (apart from disabling the button after a single submit), most web frameworks like Struts provide a token mechanism. I am searching for the equivalent of this in GWT. 回答1: If you want to avoid submitting twice, how about: boolean processing = false; button.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (

How to resend a GWT RPC request if it fails (or how to create persistent RPC request)?

折月煮酒 提交于 2019-12-19 03:23:50
问题 I require retrying to send a GWT RPC request if it fails (any response code other then HTTP 200). Reasons are complex so I won't elaborate on that. What I have so far is I treat all request responses in the same place like this: // We override the RpcRequestBuilder.doSetCallback method and force your service to use it // With this we can read the response headers if we need to. ((ServiceDefTarget)serviceRPC).setRpcRequestBuilder(new RpcRequestBuilder() { @Override protected void doSetCallback

GWT/ Eclipse: ClassNotFoundException com/google/gwt/dev/Compiler

元气小坏坏 提交于 2019-12-19 03:11:23
问题 i recently updated from GWT 2.0.4 to 2.1.0. Since then I cannot compile my GWT application anymore. When I click on the GWT compile button of the GWT eclipse plugin I get the following error: java.lang.NoClassDefFoundError: com/google/gwt/dev/Compiler Caused by: java.lang.ClassNotFoundException: com.google.gwt.dev.Compiler at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader

Initialize local datastore exception : No API environment is registered for this thread

天涯浪子 提交于 2019-12-18 19:32:12
问题 I would like to initialize my local data store with some data using a regular Java program (I do not want to start the Development Server and call a service/servlet), and I'm getting the following exception EXCEPTION : Exception in thread "main" java.lang.NullPointerException: No API environment is registered for this thread. at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java:108) at com.google.appengine.api.datastore.DatastoreApiHelper

Check String whether it contains only Latin characters?

半腔热情 提交于 2019-12-18 19:08:31
问题 Greetings, I am developing GWT application where user can enter his details in Japanese. But the 'userid' and 'password' should only contain English characters(Latin Alphabet). How to validate Strings for this? 回答1: You can use String#matches() with a bit regex for this. Latin characters are covered by \w . So this should do: boolean valid = input.matches("\\w+"); This by the way also covers numbers and the underscore _ . Not sure if that harms. Else you can just use [A-Za-z]+ instead. If you

Get Date details (day, month, year) in GWT

∥☆過路亽.° 提交于 2019-12-18 18:49:23
问题 I need to get the day, month, year details from a Date value but getYear() is deprecated, gives year on 2 digits, and has problems with Y2K (2008 gives 108). The java doc recommends using java.util.calendar but it is not supported in GWT. I want to avoid sending all the info back and forth between the server and client just to deal with dates. Edit: Calendar might be supported Date handling functions should be implemented in GWT futur versions : http://code.google.com/p/google-web-toolkit

GWT Dynamic Locale

独自空忆成欢 提交于 2019-12-18 18:36:01
问题 I want to set gwt-locale taking user chosen locale with the help of Spring LocaleContextHolder . public static final String getCurrentLocale() { return LocaleContextHolder.getLocale().getLanguage(); } I actually have login interface in Spring MVC and inner Dashboard in gwtp . The same locale user chooses in outer interface before login has to be passed to gwt as well. Unfortunately, I don't see any gwt inbuilt Locale setters. My X.gwt.xml with default locale as kh is : <inherits name="com

Debug GWT Application with Tomcat (Eclipse)

扶醉桌前 提交于 2019-12-18 18:08:10
问题 I have tried to deploy the application with tomcat and I am succeeded. Now instead of internal GWT server I need to set tomcat as default inbuilt server and debug my application with it. The problem here I am facing is I am able to upload file into hosted mode successfully but when I tried to deploy my application to tomcat it gives me error to Struts interceptor. ERROR ParametersInterceptor.setParameters():242 - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting

gwt maven project flavors: WebAppCreator or gwt-maven-plugin-Archetype - what to use

北城余情 提交于 2019-12-18 18:03:51
问题 I need a maven project configuration for a gwt project. The configuration should run in Eclipse (3.7!?) and from console (mvn, jenkins...). I tried webAppCreator delivered with gwt: webAppCreator.cmd -noant -maven -XnoEclipse -out WebAppCreated com.example.MyApp And gwt-maven-plugin Archetype. Both project look very similar in Eclipse but they have very different configurations (different directories, and use of different plugins). I think they will behave very different if project evolves

Add custom text to Google Visualization tooltip (using GWT API)

风格不统一 提交于 2019-12-18 17:29:46
问题 The following question almost entirely describes what I'm trying to to... Add custom text to Google Visualization tooltip ... basically to add extra information to google-viz tooltips. The accepted answer looked pretty good but I'm using the GWT API. From the look of the latest version (1.1) data table doesn't support this... http://gwt-google-apis.googlecode.com/svn/javadoc/visualization/1.1/com/google/gwt/visualization/client/DataTable.html ... is anyone aware of any fix or workaround for