public static File dataDirectory = new File("card_designer");
I prepend this File to each new File I open. So now I just need to construct a URL to grab these images.
I have tried:
public static String accessURL = GWT.getModuleBaseURL();
On constructing an Image widget for my dynamic images, I append the relative filepath to this accessURL, as so:
Image example = accessURL + "card_designer/exampleImage.jpg";
However, I get a 404 file not found in my console on development mode:
404 - GET //http://127.0.0.1:8888/carddesigner/card_designer/exampleImage.jpg (127.0.0.1) 1444 bytes
I think I'm close, but I don't understand why the GET request fails. The images is right there on the disk.
On Wednesday, June 6, 2012 3:24:53 PM UTC+1, Piro wrote:
I don't think you can access files in this manner. If it would be possible it would mean you can access any file on server(no security).What you have to do is to store the file anywhere and generate some sort of ID for it. Then you need to implement HTTP GET request by servlet. Servlet will need to map ID to file location and write file to response (and set some things like content type).
Iam sure there are other ways (REST,...).
Piro
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/-34L4K1C8SwJ.
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