ky schrieb:
> I am trying to have the server read from a file, called "config.txt",
> in the same directory as the main .html file within the war.
>
> In hosted mode, I can easily access the file using a Scanner object:
>
> Scanner s = new Scanner("config.txt");
>
> But this does not work when deployed because the file paths are
> somehow different. How can I get the correct file path to access
> config.txt in the deployed version?
getClass().getResourceAsStream("/config.txt");
It returns null if the file can't be found. if you place the
config-file in the same package as the class reading it, you
can leave away the slash.
Regards, Lothar
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.