-
1. Re: a4j:mediaOutput and bytearray from database
fuubah Feb 20, 2012 8:40 AM (in response to fuubah)1 of 1 people found this helpfulgot it working with pure JSF, i wrote a servlet. In case anyone wants to know how i post the code.
@WebServlet("/imgservlet")
public class imgservlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
byte[] imageData = ### call method which returns a ByteArray ### ; <---- i removed the methodcall just in this post
response.reset();
response.setContentType("image/jpg");
response.getOutputStream().write(imageData);
response.getOutputStream().flush();
}
}
code in the index.xhtml:
<h:graphicImage value="/imgservlet" />
But i still not know how to do this with mediaoutput, would be cool if someone can help me.