Label - Description - displayed Image, not in the Theme directory

Can anyone use a Image in the WEB-INF directory as displayed image in a description of a component, for example Label?

I’ve tryed it with:

label.setDescription("<img src=\"../IMAGENAME\"/>");
label.setDescription("<img src=\"./IMAGENAME\"/>");
label.setDescription("<img src=\"IMAGENAME\"/>");

I have copy the image in the WEB-INF directory, in the webapp directory and in the themes directory of vaadin.

Only when the image is in the themes directory of vaadin , can I displayed it?

For example:

label.setDescription("<img src=\"../VAADIN/themes/reindeer/images/" + temp.getName() + "\"/>");

Thanks in advance for Your help.

Hi Christian,

This is probably due to the mappings in your web.xml file. A Vaadin application maps all URIs to be handled by the application servlet by default. This means that every request gets parsed by the application servlet, which for the /VAADIN/* case always just forwards the actual file to the client. This is why it works when you put your image in the theme directory.

So, in short, you need to specify the files / directories that you want your servlet container to just offer as a normal HTTP server in the web.xml file.

HTH,
/Jonatan

Thanks a lot, it works perfect.