GWT issue in reading file from classpath

103 views
Skip to first unread message

shankar

unread,
Dec 13, 2012, 9:52:16 AM12/13/12
to Google Web Toolkit
Hi,

Can someone help me out here pleaseeeeeeeeee, am trying to read and
write the CSV / XLS file into the classpath
below snippet to Write a file in to the location CSV in the weblogic
domain directory

String fileName="CSV/Failures"+System.currentTimeMillis()+".csv";

writer = new FileWriter(fileName);

this creates the file in the specified location , but when i attempt
to read this ended up with the below exception


Bellow the code snippet to read the file from the same location.

String filename="/CSV/Failures"+System.currentTimeMillis()+".csv";

Window.open(fileName, "_self",null);

Exception
----------------------------------

Error 404--Not Found
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:10.4.5 404 Not
Found

The server has not found anything matching the Request-URI. No
indication is given of whether the condition is temporary or
permanent.

Thanks in advance :)

Jens

unread,
Dec 13, 2012, 12:21:15 PM12/13/12
to google-we...@googlegroups.com
I am pretty sure that when you call System.currentTimeMillis() two times you get two different results because time moves on ;-)

-- J.

shankar

unread,
Dec 17, 2012, 2:23:34 AM12/17/12
to google-we...@googlegroups.com


On Thursday, December 13, 2012 10:51:15 PM UTC+5:30, Jens wrote:
I am pretty sure that when you call System.currentTimeMillis() two times you get two different results because time moves on ;-)

-- J.

hi Jens,

thanks for your reply. lets say that file is hardcoded but still am unable to read it

 String fileName="CSV/Failures.csv";

 writer = new FileWriter(fileName);

Pedro Lamarão

unread,
Dec 17, 2012, 10:05:59 AM12/17/12
to google-we...@googlegroups.com

GWT is about compiling JavaScript which runs in the browser.
Your code is clearly server side code running in some J2EE.
You will find Google is rich with links to articles about reading and writing files from web applications in J2EE web containers.

--
 P.
 
Reply all
Reply to author
Forward
0 new messages