Friday, September 3, 2010

Re: Please help

Hello,

You've managed to hit the most common problem that new GWT developers
run into. Here's the deal: GWT is written in the Java syntax (which
is really cool) and then the GWT compiler converts it into Javascript
(since it is running in a browser). So here's the common mistake:
not all of Java's huge library base is convertible by the GWT compiler
into Javascript. What that error is really saying is "you are
importing a Java library that GWT can't convert into Javascript".
java.io is one of those libraries that everyone wants to work in GWT,
but I don't think will ever happen (I'm not affiliated with GWT in any
way..) If you think of what java.io can do, it is completely
contradictory to what the browser is allowed to do to the native file
system. Said another way: there are many things that the browser is
explicitly not allowed to do, and reading the local file system is one
of them. So if you are going to absolutely need this functionality,
you'll have to do it another way using another technology....

Does this make sense?

Later,

Shaffer

On Sep 2, 2:47 am, Albs <albintha...@gmail.com> wrote:
> Hi...I am new to GWT and i'm trying to develop a small
> application...but here i need to open a directory and count the no.of
> files in it.......I'm doing it as follows:
>
> File dir = new File(file);
> String[] pages = dir.list();
> int count = pages.length;
>
> I have imported java.io.File but the GWT compiler gives me the
> following error.....plz help....
>
> No source code is available for type java.io.File; did
> you forget to inherit a required module?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment