This content has been marked as final.
Show 1 reply
-
1. Re: h:graphicImage instead of s:graphicImage
danielc.roth Oct 7, 2008 3:29 PM (in response to nimo22)h:graphicImage points to a path relative to the web server.
s:graphicImage looks for a file on the disk, so that it can be read and transformed. Do something like (this is just written, not checked at all):
<s:graphicImage value="#{myBean.image}"/>
and
@Name("myBean") public class MyBean { public InputStream getImage() { getClass().getResourceAsStream("/img/bla.jpg"); } }
Depending on what AS you use you might get away with
<s:graphicImage value="/path/to/file.jpg"/>
s:graphicImage will then use the given path to get the stream with something like ResourceLoader.instance().getResourceAsStream(
/path/to/file.jpg
);