How can i display blob (picture) using jsp

i can get byte array from oracle database.
and how can i use byte array to display just like img src = '' in html ?
thankyou

You can't. You have to use <img src...> in the HTML. That src can be to a servlet that gets the image data from the DB and writes the image data out, of course. Just set the content type to image/jpeg or image/gif or whatever it is.

Similar Messages

  • I can't access the menu of my iPad because it is locked by a picture i was manipulating. How can i display that picture?

    I can't access the menu of my iPad because it is locked by a picture i was manipulating. How can i display that picture?

    http://support.apple.com/kb/ht1212

  • HELP!!!!Display blob image using JSP

    Hi,
    I am trying to blob image using JSP but it did not display successfully.
    Can someone help, please?
    below are the codes snippet:
    <td>
    <img src="display_image.jsp?ID=<%=request.getParameter("ID") %>" width="115" border="0">
    </td>
    byte[] image_blob = details.getImageByteArray();
    response.setContentType("image/jpeg");
    //response.setContentType("image/gif");
    //BEGINNING OF SECTION TO DISPLAY IMAGE
    /*OutputStream fos = null;
    fos = response.getOutputStream();
    fos.write(image_blob, 0, image_blob.length);
    fos.flush();
    fos.close();*/
    java.io.FileOutputStream fos1 = new java.io.FileOutputStream("C:\\"+id+".jpg");
    fos1.write(image_blob);
    fos1.close();
    OutputStream o = response.getOutputStream();
    System.out.println("o");
    o.write(image_blob);
    System.out.println(image_blob);
    System.out.println("write image");

    Use Java Image or BufferedImage instead of obscure byte array for image data.
    Here's an example code for a JSP document:
    <%
    String wid = request.getParameter("percent");
    String cost = request.getParameter("suchi");
    response.reset(); //IMPORTANT !
    response.setContentType("image/jpeg");
    // for testing purpose
    if (wid == null) wid = "58";
    if (cost == null) cost = "3400";
    float dleng = Float.parseFloat(wid) * 2.6f;
    RenderedImage rimg = drawGraph(dleng);
    OutputStream os = response.getOutputStream();
    try{
      ImageIO.write(rimg, "jpg", os);
    catch(IOException e){
    os.flush();
    %>
    <%!
    public RenderedImage drawGraph(float barLength){
      final int w = 800;
      final int h = 18;
      final int x = 0;
      final int y = 0;
      BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
      Graphics2D g2 = img.createGraphics();
      Color c = new Color(Integer.parseInt("FF9999", 16));
      g2.setColor(Color.yellow);
      g2.fillRect(x, y, w, h);
      g2.setColor(c);
      g2.fillRect(x, y, (int)barLength, h);
      g2.dispose();
      return img;
    %>

  • How can we store xml data using jsp

    hai,
    Can anyone please explain in brief how to store xml data using jsp. Also if possible please explain by specifying the code.
    regards,
    Praveen Vinnakota.

    [email protected] wrote:
    how can we publish Labview data using the web?
    You could use shared variables and publish them to the network or use data sockets.
    Kudos always welcome for helpful posts

  • How can I display some OrdImages using a Applet in html or Jsp?

    hi
    I want to use a applet to display some images retrieved from intermedia OrdImage Object.
    Now ,I know that a applet can display some image objects or some images with their own filepaths. But we can get ordimag objects from Oracle database.And we can image data or image properties by ordimage java mathod. It is in html/Jsp environment. So how can I transform from ordimage to applet?? I appreciate someone who can help me!
    Bill

    Do you mean applet or Servlet?
    An Applet is java code that is downloaded over the web and runs in a web browser environment. Is this what you are doing?
    I suspect you are really talking about servlet/JSP environments, and the ability to include images from the database in a web page.
    In either case (applet or servlet), you want to be able to access images via a URL. For a Servlet/JSP/web page, this URL will be specified in a HTML <IMG> tag with a key as a parameter to the image you wish to view. Images are not in-line downloaded in a web page. They are access after the HTML is loaded, and are accessed with URLs, sometimes relative URLs rather than fully specified URLs.
    To deliver images to the web from the database using the PL/SQL gateway and iAS, where the procedures are generated by a wizard, see:
    http://otn.oracle.com/software/products/intermedia/htdocs/descriptions/imedia_code_wizard.html
    You can create a simple servlet (JSPs can not deliver binary data) that delivers database images using java classes. See:
    http://otn.oracle.com/software/products/intermedia/htdocs/descriptions/servlets_jsp.html
    http://otn.oracle.com/sample_code/products/intermedia/htdocs/intermedia_servlet_jsp_samples/imedia_servlet_jsp_readme.htm
    for a sample.

  • How do i display Jasper Report Using Jsp

    Hi,
    Can anyone give me the code snippet of how to display a jasper report using jsp
    Thanx in advance
    --H                                                                                                                                                                                                                                           

    JasperReport jasperReport =
    JasperCompileManager.compileReport(file);
    JasperPrint jasperPrint = JasperFillManager.fillReport(
    jasperReport, null, conn);
    JasperExportManager.exportReportToHtmlFile(
    jasperPrint, tDest);
    JasperViewer.viewReport(jasperPrint);
    //replace file -> .jrxml file source path
    conn -> database connection name
    tDest -> .html file destination

  • How can I display comments when using poll

    hi Experts,
    I am using wc11.1.1.5 with poll function, I published a poll with some questions and a text box for suggestion feedback, when I check result, I can only get answers for the question but no suggestions can be displayed, how can I get the suggestion displayed?
    Best regards

    You have to customize surveyResults.jsff page fragment that is available in "WebCenter Polls and Surveys Service View" library. You can find this library by creating a WebCenter Spaces Task flow Customization project from Jdeveloper. Kindly do let me know if you need more details in this regard.
    You have add output or label in surveyResults.jsff and then map its value attribute with RE of suggestion text area might be available in surveyResultBean class.
    How to customize task flow, pls see following link:-
    http://download.oracle.com/docs/cd/E21764_01/webcenter.1111/e10148/jpsdg_taskflows.htm#BACIEGJD

  • How do i display jasper reports using jsp

    Can anyone help me to display jasper reports in jsp pages
    Thanx in advance

    hi
    Thank you for such a great answer.
    I have a problem here,
    When i generate report using this code all other report formats are generated very good, but the html report is not generated properly. i get nullpx in the img src e.g
    <td><img alt="" src="nullpx" style="width: 20px; height: 1px;"/></td>
    Please help me
    and
    Thanks in advance
    snkr
    Following is the html code of the generated report.
    start--------------------------------------
    =======================================================
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <style type="text/css">
    a {text-decoration: none}
    </style>
    </head>
    <body text="#000000" link="#000000" alink="#000000" vlink="#000000">
    <table width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr><td width="50%"> </td><td align="center">
    <a name="JR_PAGE_ANCHOR_0_1"/>
    <table style="width: 620px" cellpadding="0" cellspacing="0" border="0" bgcolor="white">
    <tr>
    <td><img alt="" src="nullpx" style="width: 200px; height: 1px;"/></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 1px;"/></td>
    <td><img alt="" src="nullpx" style="width: 200px; height: 1px;"/></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 1px;"/></td>
    <td><img alt="" src="nullpx" style="width: 135px; height: 1px;"/></td>
    <td><img alt="" src="nullpx" style="width: 45px; height: 1px;"/></td>
    <td><img alt="" src="nullpx" style="width: 20px; height: 1px;"/></td>
    </tr>
    <tr valign="top">
    <td colspan="8"><img alt="" src="nullpx" style="width: 640px; height: 30px;"/></td>
    </tr>
    <tr valign="top">
    <td><img alt="" src="nullpx" style="width: 20px; height: 60px;"/></td>
    <td colspan="5" valign="middle" style="text-align: center;"><span style="font-family: sansserif; font-size: 20.0px; font-weight: bold;">
                       Report Background Demo
    </span></td>
    <td colspan="2"><img alt="" src="nullpx" style="width: 65px; height: 60px;"/></td>
    </tr>
    <tr valign="top">
    <td><img alt="" src="nullpx" style="width: 20px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 13.0px; font-weight: bold;">Parent_ID</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 13.0px; font-weight: bold;">Product_ID:</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td colspan="3"><span style="font-family: Times; font-size: 13.0px; font-weight: bold;">Name:</span></td>
    </tr>
    <tr valign="top">
    <td colspan="8"><img alt="" src="nullpx" style="width: 640px; height: 6px;"/></td>
    </tr>
    <tr valign="top">
    <td><img alt="" src="nullpx" style="width: 20px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">0</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">001</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td colspan="3"><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">Colour Cosmetcis</span></td>
    </tr>
    <tr valign="top">
    <td colspan="8"><img alt="" src="nullpx" style="width: 640px; height: 6px;"/></td>
    </tr>
    <tr valign="top">
    <td><img alt="" src="nullpx" style="width: 20px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">001</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">001-001</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td colspan="3"><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">Lipsticks</span></td>
    </tr>
    <tr valign="top">
    <td colspan="8"><img alt="" src="nullpx" style="width: 640px; height: 6px;"/></td>
    </tr>
    <tr valign="top">
    <td><img alt="" src="nullpx" style="width: 20px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">001</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">001-321</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td colspan="3"><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">Eye Shadow</span></td>
    </tr>
    <tr valign="top">
    <td colspan="8"><img alt="" src="nullpx" style="width: 640px; height: 6px;"/></td>
    </tr>
    <tr valign="top">
    <td><img alt="" src="nullpx" style="width: 20px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">001</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">001-322</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td colspan="3"><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">Shankar</span></td>
    </tr>
    <tr valign="top">
    <td colspan="8"><img alt="" src="nullpx" style="width: 640px; height: 6px;"/></td>
    </tr>
    <tr valign="top">
    <td><img alt="" src="nullpx" style="width: 20px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">001-322</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">001-322-001</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td colspan="3"><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">test</span></td>
    </tr>
    <tr valign="top">
    <td colspan="8"><img alt="" src="nullpx" style="width: 640px; height: 6px;"/></td>
    </tr>
    <tr valign="top">
    <td><img alt="" src="nullpx" style="width: 20px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">001-322</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">001-322-002</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td colspan="3"><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">Parikchya</span></td>
    </tr>
    <tr valign="top">
    <td colspan="8"><img alt="" src="nullpx" style="width: 640px; height: 6px;"/></td>
    </tr>
    <tr valign="top">
    <td><img alt="" src="nullpx" style="width: 20px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">001</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">001-323</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td colspan="3"><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">test</span></td>
    </tr>
    <tr valign="top">
    <td colspan="8"><img alt="" src="nullpx" style="width: 640px; height: 6px;"/></td>
    </tr>
    <tr valign="top">
    <td><img alt="" src="nullpx" style="width: 20px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">001</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">001-324</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td colspan="3"><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">first</span></td>
    </tr>
    <tr valign="top">
    <td colspan="8"><img alt="" src="nullpx" style="width: 640px; height: 6px;"/></td>
    </tr>
    <tr valign="top">
    <td><img alt="" src="nullpx" style="width: 20px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">001-324</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">001-324-001</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td colspan="3"><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">first</span></td>
    </tr>
    <tr valign="top">
    <td colspan="8"><img alt="" src="nullpx" style="width: 640px; height: 6px;"/></td>
    </tr>
    <tr valign="top">
    <td><img alt="" src="nullpx" style="width: 20px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">0</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">002</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td colspan="3"><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">hair Cleaner</span></td>
    </tr>
    <tr valign="top">
    <td colspan="8"><img alt="" src="nullpx" style="width: 640px; height: 6px;"/></td>
    </tr>
    <tr valign="top">
    <td><img alt="" src="nullpx" style="width: 20px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">002</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">002-001</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td colspan="3"><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">Kumar</span></td>
    </tr>
    <tr valign="top">
    <td colspan="8"><img alt="" src="nullpx" style="width: 640px; height: 6px;"/></td>
    </tr>
    <tr valign="top">
    <td><img alt="" src="nullpx" style="width: 20px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">002</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">002-002</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td colspan="3"><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">Magilla Gorilla</span></td>
    </tr>
    <tr valign="top">
    <td colspan="8"><img alt="" src="nullpx" style="width: 640px; height: 6px;"/></td>
    </tr>
    <tr valign="top">
    <td><img alt="" src="nullpx" style="width: 20px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">002</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">002-003</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td colspan="3"><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">astrigent</span></td>
    </tr>
    <tr valign="top">
    <td colspan="8"><img alt="" src="nullpx" style="width: 640px; height: 6px;"/></td>
    </tr>
    <tr valign="top">
    <td><img alt="" src="nullpx" style="width: 20px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">0</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">003</span></td>
    <td><img alt="" src="nullpx" style="width: 10px; height: 24px;"/></td>
    <td colspan="3"><span style="font-family: Times; font-size: 15.0px; font-weight: bold;">test1</span></td>
    </tr>
    <tr valign="top">
    <td colspan="8"><img alt="" src="nullpx" style="width: 640px; height: 96px;"/></td>
    </tr>
    <tr valign="top">
    <td colspan="8"><img alt="" src="nullpx" style="width: 640px; height: 170px;"/></td>
    </tr>
    </table>
    </td><td width="50%"> </td></tr>
    </table>
    </body>
    </html>
    end------------------------------
    ========================================================

  • How can I upload an image using JSP in database(MySQL)

    I have to develop an application in which users can register themselve by filling up thier information(name, address) etc along with their photo.
    Storing nam etc. is simple but i am unable to upload photo using JSP.

    Here are lot of examples: http://www.google.com/search?q=jsp+file+upload
    Or if you actually have implemented something which doesn't work as expected, then please ask specific questions.

  • How can i display multiple Pictures in a java.awt.Container best?

    hi,
    I just started with a new Project, it works just like a FileManager.
    On entering a directory all the files in it shall be displayed in a scrollable area. Displayed means here a Graphical representation of the file, in case of a picture a small preview version of it.
    I put together a javax.swing.JScrollPane with a java.awt.Container and viewport. The Container has a FlowLayout.
    Now for every image in a Directory I create a Component-class in witch I overwrote the public void paint(Graphics g) to display a scaled version of the image, this scaled version is created in the Constructor of my Component-class.
    this works fine for just a few images, but if i try to open a directory with a lot of pictures it takes a long time at the beginning and sometimes it just kills the application.
    so i changed in a way that only when a Component is in view of the visible rectangle of the scroll pane the scaled image will be created, and when the component gets out of view the image is set to null.
    now it is running without killing the application, but it takes way too long to scroll now, because the images are loaded all the time.
    so i figured i must be doing something wrong, so what is the best way to get small previews for up to a few hundred files and then display them in a scrollable area? (like in Windows Explorer if you activate the miniature preview)
    if anyone can give me some hints, that would be great
    thanks shirasuresh

    This might give you some ideas:
    import java.awt.*;
    import javax.swing.*;
    public abstract class LazyIcon implements Icon {
        private int width;
        private int height;
        private Image image;
        public LazyIcon(int width, int height) {
            this.width = width;
            this.height = height;
        protected abstract Image createImage();
        public int getIconHeight() {
            return width;
        public int getIconWidth() {
            return height;
        public void paintIcon(Component comp, Graphics g,int x, int y) {
            if (image == null)
                image = createImage();
            g.drawImage(image, x, y, comp);
    }You could also do this with a custom component class, but I like the JLabel + Icon combination.
    Any if you want to get fancy, you could load images in another thread, at low priority, so when the user is just sitting there, your code is preparing the panel for scrolling ;-)
    Message was edited by:
    BigDaddyLoveHandles

  • How can I display more info using remote app?

    Hi there,
    I use remote app a lot, but I find it quite basic in the display features.
    I mean: remote is great to browse my music library and play songs with on my living room hi-fi while I'm sitting comfortable on my sofa.
    But what if I would like to know the release date of the album, the name of the composer, and so on?
    Is there any way to configure the remote app to display more?
    Is any kind of new release of the app on its way?
    Thank you.

    Command (right) - click on a photo in the Photo tray and select Small Photo from the contextual menu:
    This will give you two columns of photos.
    To reduce the number of photos to select from one can select only Unplaced Photos to be displayed in the tray.
    Happy Holidays

  • How can I add excel pictures using activex

    I would like to be able to use activex to insert an image into an excel spreadsheet. I know how to read and write data, but the chart feature is too cunmbersome and when I updated excel to 2007 most of the calls stopped working. I see that there is a pictures property/method that lets me specify an image file, but I don't know which property/method(s) to call it from.

    2007 does take more time to draw the data on the chart. I am not having any problems with errors on the active X for 2007. I is much slower than 2003 I would agree. My IT group moved us to 2007 so I am stuck with it no matter how slow it is. I am trying to figure out how to get the help file back. I had these in 2003 myself. I know it has nothing to do with LabVIEW. It is an add in or some switch that you need to throw in excel to allow for this connection.
    Tim
    Johnson Controls
    Holland Michigan

  • How can i flip through pictures using gestures in iPhone 2011

    In the previous version of iPhoto, I could flip through my pictures within Events using the same gesture I'd use in Safari to go back and forth.  Not sure if its the Mac OS Lion update or the iPhoto update to 2011, but I can't do that anymore.  Can anyone help?  Thanks
    Message was edited by: jesusfrombrooklyn

    What application are you using? In iPhoto you can just use the right and left arrow keys to browse photos...
    Clinton

  • Problem with displaying BLOB images on JSP page using a servlet

    hi. I have a big problem with displaying BLOB images using JSP. I have a servlet that connects to the oracle database, gets a BLOB image , reads it, and then displays it using a BinaryStream. The problem is , this works only when i directly call that servlet, that is http://localhost:8080/ImageServlet. It doesn't work when i try to use that servlet to display my image on my JSP page (my JSP page displays only a broken-image icon ) I tried several coding approaches with my servlet (used both Blob and BLOB objects), and they work just fine as long as i display images explicitly using only the servlet.
    Here's what i use : ORACLE 10g XE , Eclipse 3.1.2, Tomcat 5.5.16 , JDK 1.5
    here is one of my image servlet's working versions (the essential part of it) :
                   BLOB blob=null;
              rset=st.executeQuery("SELECT * FROM IMAGES WHERE ID=1");
              while (rset.next())
                   blob=((OracleResultSet)rset).getBLOB(2);
              response.reset();
              response.setContentType("image/jpeg");
              response.addHeader("Content-Disposition","filename=42.jpeg");
                    ServletOutputStream ostr=response.getOutputStream();
                   InputStream istr=blob.getBinaryStream(1L);
                    int size=blob.getBufferSize();
              int len=-1;
                    byte[] buff = new byte[size];
                         while ((len=istr.read( buff ))!=-1 ) {
                   ostr.write(buff,0,len);
             response.flushBuffer();
             ostr.close(); and my JSP page code :
    <img src="/ImageServlet" border="0"  > If you could just tell me what i'm doing wrong here , or if you could show me your own solutions to that problem , i would be very greatful ,cos i'm realy stuck here , and i'm rather pressed for time too. Hope someone can help.

    I turns out that it wasn't that big of a problem after all. All i had to do was to take the above code and place it into another JSP page instead of into a servlet like i did before. Then i just used that page as a source for my IMG tag in my first JSP. It works perfectly well. Why this doesn't work for servlets i still don't know, but it's not a problem form me anymore . Ofcourse if someone knows the answer , go ahead and write. I would still appriceatte it.
    here's the magic tag : <img src="ImageJSP.jsp" border="0"  > enjoy : )

  • How can i display the values in the vector in a jsp using jstl

    in a task i am recieving a vector in a jsp... how can i display those vector values in the jsp using jstl.... plz help me
    thanks in advance

    <%
    here you got vector say; v
    pagecontext.setAttribute("varname",v);
    %>
    <c:forEach var="i" items="${varname}">
    <c:out value="${i}">
    </c:forEach>

Maybe you are looking for

  • Can't get past login screen and accidentally added a Firmware password?

    Hi, please can you help me. Up until about a week ago my Mac Mini Server (running snow leopard server) was working fine, but when I re-started my user name and password stopped working (the panel shakes). I booted the computer from the Install DVD an

  • Latest xkeyboard-config prevents ctrl-alt-backspace from killing X

    well, as I wrote in the topic latest xkeyboard-config (1.6-1) is preventing ctrl-alt-backspace combination from killing X.  I have DonZap option set to false in my xorg.conf. I don't know if it should be like that. Is it a bug? If not, is it any work

  • Can I lock the volume curve to the track so it moves with the track?

    I can't seem to move the volume curve when I move the section or track. Is it possible to lock the volume curve to the track or section? Otherwise I have to recreate the curve for that section or track which seems so completely inefficient that I can

  • OneDrive (SkyDrive) only sync's to the roaming profile of 1 pc?

    Hi, We got a problem with our Onedrive (we got the latest version), we make use of SharePoint 2013 and Office 2013 (we do not use Ofice 365). The SharePoint libraries we sync are stored in our local roaming file, but if i log on into another pc these

  • Multiple selection in alv

    how to select multiple values in the generated output list for futher selection criteria in alv's without using oop's concept basically using  " reuse_alv_grid_display"  function module