Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Images with ClassResource

Aleksi Peltomaki
1 decade ago Aug 14, 2010 11:47am
Henri Muurimaa
1 decade ago Aug 16, 2010 11:52am

Hi,

The servlet can't see the image, because your project is not in the servlet container classpath. I suggest that you create a new theme and reference your images from there. How to do this:

  1. Create a new theme, eg. MyTheme (more info). Don't forget the setTheme("MyTheme") call in Application.init().
  2. Move your Images directory under WebContents/VAADIN/themes/MyTheme/
  3. Use your images in the app with ThemeResource("Images/omaalus.jpg")
Scott Tucker
1 decade ago Sep 28, 2010 3:06am
Henri Sara
1 decade ago Sep 28, 2010 5:43am
jinlong hu
9 years ago Aug 08, 2013 3:42pm