myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Gustavson <goo...@gmail.com>
Subject Re: rendering an image URL
Date Mon, 07 Mar 2005 21:26:08 GMT
thanks Heath. I got it working by doing this:


ResponseWriter writer = context.getResponseWriter();
writer.startElement("img", this);

StringBuffer src = new StringBuffer();
... create the URL, starting with a "/" but no context-root

String url = context.getApplication().getViewHandler().getResourceURL(context,
src.toString());

writer.writeURIAttribute("src",
context.getExternalContext().encodeResourceURL(url), null);

writer.endElement("img");

Mime
View raw message