Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

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

Here Locale is an instance of java.util.Locale.

I'm getting an exception: 09:31:53.656 [ERROR] [stockwatcher] Line 167 No source code is available for type java.util.Locale; did you forget to inherit a required module?

Surprisingly, in this class I've also used java.util.ArrayList and java.util.Date but I did not get any exception for those classes.

What am i doing wrong here?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
394 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...