Hi,
in the example of http://anonsvn.jboss.org/repos/richfaces/branches/community/3.3.X/samples/mediaOutput
the value property contain a name of file :
<a4j:mediaOutput element="object" cacheable="false" session="true" value="rc044-010d-richfaces_3.pdf" createContent="#{bean.paint}" type="application/pdf">something</a4j:mediaOutput>
public void paint(OutputStream out, Object data) throws IOException { if (data instanceof String) { InputStream file = FacesContext.getCurrentInstance() .getExternalContext().getResourceAsStream((String) data); int size = file.available(); byte[] pdf = new byte[size]; file.read(pdf); file.close(); out.write(pdf); }
working fine with version 3.3.2 of richfaces