GWT - did you forget to inherit a required module?

后端 未结 2 1632
北荒
北荒 2020-12-18 18:34

In my GWT application, on the client side Java file, I have written a line to print the Locale:

System.out.println(Locale.getDefault());


        
相关标签:
2条回答
  • 2020-12-18 19:05

    In addition to information in RAS's answer, you could use GWT's class LocaleInfo to obtain information about available locales or current locale.

    System.out.println(LocaleInfo.getCurrentLocale());
    

    Hope this helps!

    0 讨论(0)
  • 2020-12-18 19:23

    The client-side of GWT does not have access to the whole Java API. Java.util.Locale is one of them. You can't use or even import it on the client-side. But you can definitely use it on the server-side of GWT. You can find the list of classes that can be used at client-side here.

    0 讨论(0)
提交回复
热议问题