"Xavier Michel" <[EMAIL PROTECTED]> writes:
> Hi,
>
> May be it's newbies question... :-/
>
> I tried to show an image coming from mySQL. found nothing in the doc and
> mail-archive.
>
> I did :
> ....
> public class ArtisteTrombine extends HttpServlet {
> protected void doGet(HttpServletRequest req, HttpServletResponse res)
> throws ServletException, IOException {
>
> byte[] trombine = null;
> try {
> Criteria aCriteria = new Criteria();
> Vector aResultList = ArtistePeer.doSelect(aCriteria);
> Artiste aArtiste = (Artiste) aResultList.firstElement();
> trombine = aArtiste.getTrombine();
>
> if (trombine != null) {
> res.setContentType("image/jpeg");
> ServletOutputStream out = res.getOutputStream();
> out.write(trombine);
> }
> }
> catch (Exception e ) {
> Log.debug(e.getMessage());
> }
> }
> }
>
> and in my template :
>
> <img src="/servlets/pf.cs.gtr.modules.actions.ArtisteAction" >
I've done this before in other languages than Java, and your Java code
looks perfect. I suspect your URL...if your class is a regular HTTP
servlet (ArtisteTrombine), then why do you reference ArtisteAction in
your <img> src attribute?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]