wrong image source, no error for debug?

19 views
Skip to first unread message

tong123123

unread,
Jan 20, 2012, 4:40:07 AM1/20/12
to Google Web Toolkit
I am new to GWT and I follow the tutorial
http://code.google.com/webtoolkit/doc/latest/tutorial/style.html
and
add the image by
<img src="images/GoogleCode.png" />

but I find the image cannot be shown on my browser, finally I find
that the image is not saved in that path "images/GoogleCode.png", but
due to no any error message, it is quite difficult to debug.

is there any debug message shown for easier debug?

Thomas Broyer

unread,
Jan 20, 2012, 5:12:54 AM1/20/12
to google-we...@googlegroups.com
If you correctly put the image in images/GoogleCode.png in your "war" folder, then <img src="images/GoogleCode.png"> should just work.

You might have an issue with how you launched the DevMode (not selecting the appropriate "war" folder?), or with following the tutorial (not putting the image in the right place on your disk?)

Just to be sure: the tutorial tells you to save the image at a certain location, this is not something that GWT or Eclipse will do automatically for you.

tong123123

unread,
Jan 20, 2012, 5:41:32 AM1/20/12
to Google Web Toolkit
yes, I put the image in the wrong folder, so the image cannot be
loaded, but the question is
"is there any debug message"
if the javascript (generate by GWT?) cannot find the image from the
path?
Also, I want to see the genereated .js file which search the image
path, how could this javascript file be found?

thanks.

Thomas Broyer

unread,
Jan 20, 2012, 5:47:46 AM1/20/12
to google-we...@googlegroups.com


On Friday, January 20, 2012 11:41:32 AM UTC+1, tong123123 wrote:
yes, I put the image in the wrong folder, so the image cannot be
loaded, but the question is
"is there any debug message"

If you're using launching DevMode from the Google Plugin for Eclipse, have a look at the Console View, which will show server logs: your browser asks for images/GoogleCode.png and the server doesn't find it, so it replies with an error (and this will appear in the logs).

Also, look at your browser's developer tools (or the "error console" in Firefox for instance).
 
if the javascript (generate by GWT?) cannot find the image from the
path?
Also, I want to see the genereated .js file which search the image
path, how could this javascript file be found?

The JS doesn't "search" the image, it generates HTML which your browser will interpret and thus ask the server for the image; so looking at the JS won't help.

Also, DevMode runs your Java code, it doesn't "generate JS" (it instead talk to your browser via the plugin you installed there).
Reply all
Reply to author
Forward
0 new messages