Wednesday, April 16, 2014

Re: images not showing in any browser

when you run MyProject look at the HTML code and see the url of the image.. So you can see where is the problem in the path.. However i've a project with images and i put the image in war/Images/1.jpg and in the code i've 
...
...
Image img = new Image();
img.setUrl("Images/1.jpg"); 
Panel p = new Panel();
p.add(img); 
...
... 


On Wed, Apr 16, 2014 at 10:51 PM, Adam <adam.trundell@googlemail.com> wrote:
Hi, i'm new to gwt programming, for some reason the image wont show in any browsers, any idea's? Also the path seems to be stuck on"/myproject//MyProject/images/1.jpg"

Image img = new Image("/MyProject/images/12345.jpg");
 vPanel.add(img);

[WARN] Server class 'org.eclipse.jetty.servlet.listener.ELContextCleaner' could not be found in the web app, but was found on the system classpath
   [WARN] Adding classpath entry 'file:/C:/eclipse%20se/plugins/com.google.gwt.eclipse.sdkbundle_2.6.0/gwt-2.6.0/gwt-dev.jar' to the web app classpath for this session
   For additional info see: file:/C:/eclipse%20se/plugins/com.google.gwt.eclipse.sdkbundle_2.6.0/gwt-2.6.0/doc/helpInfo/webAppClassPath.html
[WARN] 404 - GET /myproject//MyProject/images/1.jpg (127.0.0.1) 1398 bytes
   Request headers
      Host: 127.0.0.1:8888
      Connection: keep-alive
      Accept: image/webp,*/*;q=0.8
      User-Agent: Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36
      Referer: http://127.0.0.1:8888/MyProject.html?gwt.codesvr=127.0.0.1:9997
      Accept-Encoding: gzip,deflate,sdch
      Accept-Language: en-GB,en-US;q=0.8,en;q=0.6
   Response headers
      Content-Type: text/html;charset=ISO-8859-1
      Cache-Control: must-revalidate,no-cache,no-store
      Content-Length: 1398

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment