Problem using weblogic6.1 to show image via JSP

          I am trying to load an image from database,we use Oracle8, the data type of the
          image field is Long Raw.
          The following code can work on Tomcat, that is it can show the image, but on weblogic
          it can not.
          <%@ page import="java.sql.*,javax.servlet.*,java.io.*" %>
          <%
          //Define the database connection: bedb
          %>
          <%
          response.setContentType("image/gif");
          ServletOutputStream ot = response.getOutputStream();
          BufferedOutputStream os = new BufferedOutputStream(ot);
          byte[] b = null;
          String m_Sql="select image from Image";
          ResultSet rsimage = bedb.executeQuery(m_Sql);
          if (rsimage.next())
          b=rsimage.getBytes(1);
          if(b!=null)
          os.write(b);
          os.flush();
          os.close();
          %>
          

If you look at the generated code, you will see that there are newlines
          inserted before your image data. Your safest bet is to use servlet instead of
          JSP to generate binary data.
          nova <[email protected]> wrote:
          > I am trying to load an image from database,we use Oracle8, the data type of the
          > image field is Long Raw.
          > The following code can work on Tomcat, that is it can show the image, but on weblogic
          > it can not.
          > <%@ page import="java.sql.*,javax.servlet.*,java.io.*" %>
          > <%
          > //Define the database connection: bedb
          > ........
          > %>
          > <%
          > response.setContentType("image/gif");
          > ServletOutputStream ot = response.getOutputStream();
          > BufferedOutputStream os = new BufferedOutputStream(ot);
          > byte[] b = null;
          > String m_Sql="select image from Image";
          > ResultSet rsimage = bedb.executeQuery(m_Sql);
          > if (rsimage.next())
          > {
          > b=rsimage.getBytes(1);
          > }
          > if(b!=null)
          > {
          > os.write(b);
          > }
          > os.flush();
          > os.close();
          > %>
          Dimitri
          

Similar Messages

  • Re: Problem using weblogic6.1 to show image via JSP

              Thanks.
              But why on Tomcat it can work ??
              

    In the past, I have used O'Reilly's servlet package for multipart forms
              and uploading files. You can download it from http://www.servlets.com.
              There should also be examples on how to handle multipart forms, so I
              would suggest having a look.
              Hope that helps,
              Nils
              baiju wrote:
              >
              > hey all
              >
              > I have a form that will upload couple of files and is designed using
              > a form with
              > : the enctype="multipart/form-data". I would like to be able to send a
              > couple of
              > : other test fields in the same form. The problem is that the
              > recieving jsp page
              > : cannot seem to interpret the text fields. Any ideas on how to
              > retrieve the
              > : values from those fields?
              > : ** Currently using Request("FieldName")
              > :
              > cheers, baiju
              ============================
              [email protected]
              

  • Is some driver needed when I want to use Matrox card to aquire image via Labview?

    Is some driver needed when I want to use Matrox card to aquire image via Labview?and  I cannot afford the expense of buying a driver made by alliancevision。 If there must be some driver installed before I acquire image, can anyone email me one? Or just give me some advices.  My email address is [email protected]
    The attachment is my VI by which I attempt to acquire image, and I don't know what is the problems in it and whether it is because of the lack of the driver.
    Attachments:
    method2.vi ‏19 KB

    You asked the same question here under a different user ID. 
    Asking for someone to email you something that you must purchase is called software piracy. Nobody on this forum will help you with that.

  • Problem using text boxes as the "image" to drag and drop over audio file

    I have been adding audio files to my page in iWeb (previous version, not '08), but I am having a problem giving them titles.
    When you first drag a file from iTunes into iWeb, it provides a space for you to drag and drop a picture. The online iWeb guide also says that you can drag a text box there instead of a picture.
    I created a text box with the text I would like to drop over the controller. However, it is no longer allowing me to drop the text box there. I used to be able to do this, and I don't know what I'm doing differently now. Any suggestions?
    Thanks!
    -- Will

    foobar2000 with the ipod plugin will allow you to drag/drop FLAC files and when it syncs the ipod, it converts the FLAC files on the fly. MUCH better than dealing with the crappy iTunes interface and having to pre-convert the files. I absolutely loathe iTunes and it just gets worse and worse!

  • Problem using IMAQ Array to Color Image vi

    I am doing some pixel manipulation & while going from an image to an Image Pixels (U64) array using IMAQ Color Image to Array VI I cannot see the image once it is modified.
    I am...
    1) converting the image to the 64 bit pixel data using IMAQ ColorImage to Array.vi
    2) doing the manipulation
    3) converting back to an image using the IMAQ Array to ColorImage.vi using the 64 bit input.
    What I get is...
    1) a black image with data behind it... meaning... if I take the magnifier tool and go to the approximate locations of my image where I expect to find the manipulated data, it is there.
    2) cast that image to a 32 bit image & still get a black image for the output.  The data however is no longer there and appears to have been stripped.  
    3) no error's out of any VI's...
    TIA  

    With Vision 2009 situation is not better.
    It happened because U64 image displayed in full scale. So, if you have full range of intensities (from 0 to 65535), then you can see something. But if your intensities in small range, for example, 0...255 in all channels, then you will see black image.
    Feel differences:
    It should be possible to map U16 values into U8 display range  with given range (like IMAQ WindDisplay Mapping does), but right now this feature available for I16 images only, not for U64. What you can do is following - map each channel to U8 (with linear LUT, for example), put channels together, then display 32 bit RGB instead of U64.
    Andrey.

  • Problem using linear workflow to composite images with nonlinear transparency

    First off: I love what a fully linear workflow does for the proper behavior of gradients, transparency and the like.
    HOWEVER in both Premiere and AE I have found no simple way (within the linear workflow) to properly/accurately composite images that were not linear to start with/have nonlinear alpha channels. For example, I have an 8 bit RGB photoshop file with 2 layers: one with transparency and the other a white background. If I export the transparent layer as a png (or for that matter save it as a standalone psd), bring it into PP or AE and put a white solid behind it, it doesn't look the same as in the original photoshop file unless I turn off "composite in linear color".
    My best workaround so far is to bring the transparent image into AE (working in a linear color space) and manually adjust the gamma of its alpha channel using a combination of of track mattes/levels/shift channels effects to counteract the improper interpretation of the gamma of the alpha channel, since there's no effect or setting to change the linear/nonlinear interpretation of the gamma of the alpha channel.
    Is anyone at Adobe working on addressing this issue? Why isn't there an effect (or setting in "interpret footage") to allow us to specify if the source material has linear or nonlinear gamma? EDIT: I have just realized that there is a color management option in the AE footage interpret dialog (but not PP), but when I attempt to use it with a png it is greyed out/disabled.
    Thanks,
    Henry
    Message was edited by: Henry Reich

    Well, you could just not use PNG but instead TIFF? The behaviors are built into the file format and using a limited 8bit format in a linear workflow doesn't make that much sense in the first place...
    Mylenium

  • PLEASE HELP!!! using servlet to generate an image in jsp page

    Hi,
    I am so stuck on this... please help.
    I have a servlet that generated a gif image dynamically. It uses a bean that stores the gif image in a byte array.
    The servlet outputs the byte data to the output stream. The code is really simple and looks like this:
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            //HttpSession session = request.getSession();
            try {
                ServletOutputStream stream = response.getOutputStream();
                ImageByteInformation imageByteInfo = (ImageByteInformation) request.getAttribute("imageByteInformation");
                response.setContentType("image/gif");
                response.setContentLength(imageByteInfo.getByteData().length);
                stream.write(imageByteInfo.getByteData(), 0, imageByteInfo.getByteData().length);
                stream.flush();
            }catch( Exception e){   
                System.out.println("You are hooped!: " + e.getMessage() + " " + e.toString());           
            }When I redirect from the dispatch servlet straight to this servlet an image shows up in the browser window.
    However when I try to use this jsp page to display the image nothing happens...
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <h2>Hello World!</h2>
            <img src="servlets/Map24ImageDisplayServlet"/>
             //I also tried src/servlets/Map24..., /src/servlets/Map24..., /display, servlets/display
            <h2>Did you see the image?</h2>
        </body>
    </html>My web.xml is here if it helps...
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
      <display-name>HelloProject</display-name>
    <servlet>
        <display-name>ServletDispatcher</display-name>
        <servlet-name>ServletDispatcher</servlet-name>
        <servlet-class>servlets.ServletDispatcher</servlet-class>
      </servlet>
      <servlet>
        <display-name>Map24ImageDisplayServlet</display-name>
        <servlet-name>Map24ImageDisplayServlet</servlet-name>
        <servlet-class>servlets.Map24ImageDisplayServlet</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>ServletDispatcher</servlet-name>
        <url-pattern>/hello</url-pattern>
      </servlet-mapping>
      <error-page>
        <error-code>404</error-code>
        <location>/404_error.html</location>
      </error-page>
      <servlet-mapping>
        <servlet-name>Map24ImageDisplayServlet</servlet-name>
        <url-pattern>/display</url-pattern>
      </servlet-mapping>
    </web-app>I can never get an image to come up. In fact I can never get the jsp page to run the servlet at all! HELP!!! What am I doing wrong?
    Thanks
    Edited by: Kind_of_Green on May 5, 2008 3:55 PM
    Edited by: Kind_of_Green on May 5, 2008 4:00 PM

    OK... so you WERE absolutely right about the src path for the image tag.
    However I also had another problem that was quite a bit more insidious and mostly just a symptom
    of how little I know about what goes on under the hood of a web app.
    My bean storing the image info was stored as a request attribute. When the servlet was called from the
    jsp page the request object was either reset or just never initialized. Anyway it is not the same request
    object I assumed it was being passed in the doGet method. I added my bean as a session
    attribute and everything is sparkly :)
    I can only assume that when a request is neither forwarded nor included (as is the case with
    calling the servlet from the img tag) it is disappeared.
    Anyway, thanks a mint man. I so totally appreciate your time.
    Ciao :)

  • How to show images in jsp dynamic

    Hi all,
    I am beginner in web technology and am faced with some prob. I have a form in which user enters his unique id....n submits...then web server call ejb which fetches data for that unique id from DB and does some operation and also fetch photograph which i need to display in my response jsp along with data....this photograph is different for each ID and i want to know how to display this image , i dont want to use applet.....i need good response time..and i have lot of hits per second on my site....i was planning to have separate frame wherein image will be loaded and use AJAX for the same but i do believe their mite be some other simple method for the same please suggest.....
    Regards,
    beginner83.

    I am not great at UI, but see if this thread is of any help:
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=20&t=007725

  • Problem using custom tag library in portlet's jsp

    Hi,
    I created a custom portlet (a JSR 168 portlet) and I'm using a tag library that I previously developed. Normally it works fine, but sometimes I get a ClassCastException. Once I redeploy the portlet everything works again. This is Oracle Portal 10.1.4.
    Has anybody encountered similar problems?
    Here's the exception:
    taglib exception:
    java.lang.ClassCastException at timecardreminderportlet.html._view._jspService(_view.java:201) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824) at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:121) at oracle.webdb.wsrp.server.RequestDispatcherImpl.include(Unknown Source) at org.mitre.isis.trs.reminder.portlet.TimecardReminderPortlet.doDispatch(TimecardReminderPortlet.java:108) at javax.portlet.GenericPortlet.render(Unknown Source) at oracle.webdb.wsrp.server.Server.getMarkup(Unknown Source) at oracle.webdb.wsrp.WSRP_v1_Markup_PortType_Tie.invoke_getMarkup(WSRP_v1_Markup_PortType_Tie.java:224) at oracle.webdb.wsrp.WSRP_v1_Markup_PortType_Tie.processingHook(WSRP_v1_Markup_PortType_Tie.java:499) at com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:230) at com.sun.xml.rpc.server.http.ea.JAXRPCServletDelegate.doPost(JAXRPCServletDelegate.java:153) at com.sun.xml.rpc.server.http.JAXRPCServlet.doPost(JAXRPCServlet.java:69) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) at oracle.webdb.wsrp.server.ContextFilter.doFilter(Unknown Source) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:224) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)

    Hi,
    I created a custom portlet (a JSR 168 portlet) and I'm using a tag library that I previously developed. Normally it works fine, but sometimes I get a ClassCastException. Once I redeploy the portlet everything works again. This is Oracle Portal 10.1.4.
    Has anybody encountered similar problems?
    Here's the exception:
    taglib exception:
    java.lang.ClassCastException at timecardreminderportlet.html._view._jspService(_view.java:201) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824) at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:121) at oracle.webdb.wsrp.server.RequestDispatcherImpl.include(Unknown Source) at org.mitre.isis.trs.reminder.portlet.TimecardReminderPortlet.doDispatch(TimecardReminderPortlet.java:108) at javax.portlet.GenericPortlet.render(Unknown Source) at oracle.webdb.wsrp.server.Server.getMarkup(Unknown Source) at oracle.webdb.wsrp.WSRP_v1_Markup_PortType_Tie.invoke_getMarkup(WSRP_v1_Markup_PortType_Tie.java:224) at oracle.webdb.wsrp.WSRP_v1_Markup_PortType_Tie.processingHook(WSRP_v1_Markup_PortType_Tie.java:499) at com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:230) at com.sun.xml.rpc.server.http.ea.JAXRPCServletDelegate.doPost(JAXRPCServletDelegate.java:153) at com.sun.xml.rpc.server.http.JAXRPCServlet.doPost(JAXRPCServlet.java:69) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) at oracle.webdb.wsrp.server.ContextFilter.doFilter(Unknown Source) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:224) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)

  • Problem of showing image in opera

    hi,
    I have used following code for for showing image with jsp:
    <img src="<%=image%>"> height="100" width="100">When i open this with Internet Explorer then it can show image. But whwn open it in Opera then it cannot show images. What's the problem of my code? What will be solution of this problem? IS there anybody can help me? PLese give me a solution
    With regards
    Bina

    Did you bother to override getPreferredSize(), getMinimumSize() and getMaximumSize() to return sizes appropriate for the image you're drawing? If you didn't and you're not adding anything to the JPanel it's just going to act like an empty JPanel.

  • Zcm imaging via pxe

    hi all, i am having an issue where found out that Imaging Script cannot be used to multicast so i am running in to a problem now. If i push out an image via zcm script bundle it works fine with your suggestions but i cannot seem to figure out why the image wipes out all the hard drives in the systems during multicast image set or a single image load via pxe boot.
    First problem:
    if i push out an image via Zenworks Image preboot bundle file set is set to 1 it wipes out all the hardrvie in the system (tow hard drive, disk 0 and disk 1. i can certainly fix the disk resizing issue by adding a script to unattaned file after the image is loaded to resize the disk automatically using diskpart commands. which works fine.
    Second problem:
    here is what i did:
    1. created an multicast Image Set
    2. number of clients needed set to 1
    3. Time out in five minutes
    It does not load the image znd waits for session to start.
    how can i automate this via zcm to make sure on pxe boot the both pcs receive the image as scheduled in zcm.
    Please assist.
    thank you

    arahman147,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://forums.novell.com/

  • How to display stored image in jsp  in ie7???

    i am using internet explore7. i have a problem when i am displaying an image in jsp its not properly coming. this image and image is stored in database.
    image is stored in database using "binarystream" .
    i am just simply calling the image path and using the html image display tag.
    <img src="<%=fileIpath%>" but image is not coming properly but this image is showing properly in lower ie version.
    Can anyone help me???

    can anyone reply this question??Appearently no.
    It might be that the question is not interesting enough to attract people.
    Or it might be that the details you provided do no suffice and some important pieces of information are missing. For eample: what are the contents of the variable? If you save the generated page, what do you get?

  • Problem using image via URL

    Hi everybody
    I have a problem with loading images via URL into my PDFs.
    I am using LCD ES2 Version 9.0.1....
    I want to create a PDF which loads images from the internet but it does not work.
    So far I have tried to add an image or image field to my PDF in the LCD and populate that image using the Object-->Field-->URL: palett. I put the URL in there like this http://www.adobe.com/imageshome/pdfgift_home.gif , tick the "embed image Data" checkbox (also tried with without that just to be sure) and save as Dynamic PDF (I also tried static) but when I open the PDF in adobe reader 9 or 10 or acrobat  9 there is no image showing. I also put the image in a subform and made that subform flowed, as well as the page itself and made the binding global.
    I have the form properties - default set to "Acrobat and Adobe Reader version 9.0 or higher", Default Language to JavaScript, PDF Render format to Dynamic PDF.
    I also tried using JavaScript events like "form:ready ImageField2.value.#image.href = "http://www.adobe.com/imageshome/pdfgift_home.gif" as discribed here http://partners.adobe.com/public/developer/en/tips/lc_dynamic_images.pdf but that also does not work.
    What am I missing?
    Any help would be great and greatly appreciated!!!
    Thanks and best regards
    Norbert

    As far as I can tell, this use case is not allowed because of cross site references related security concerns. The form can refer to the images stored on the same server from where the PDF is served, but the images cannot come from external servers.

  • I am using adobe photoshop cs6. I am facing a problem. When i save any image as "save for web". After saving image it show cropped. An image show many parts of the image after saving the image. Please help me. Thanks in advance.

    I am using adobe photoshop cs6. I am facing a problem. When i save any image as "save for web". After saving image it show cropped. An image show many parts of the image after saving the image. Please help me. Thanks in advance.

    Just go back in photoshop and use the Slice Select tool, then just click and select the slice and hit delete - if you're not sure which one is the active slice just right click and find the one that has the Delete Slice option.
    It's possible you either added the slices by accident or if you received it from someone they just had the slices hidden. For the future, you can go to View > Show > Slices to display (or hide) slices.

  • HT201269 ibook stopped transferring images via image capture. last month it worked. i hav an old ibook and i cannot update to newest itunes. which is fine. however, i need the image capture to take photos off my iphone 5. no, i dont want to use i cloud.

    ibook stopped transferring images via image capture. last month it worked. i hav an old ibook and i cannot update to newest itunes. which is fine. however, i need the image capture to take photos off my iphone 5. no, i dont want to use i cloud. i would actually like to just plug it in to the usb drive the old fashioned way

    I don't believe the iOS7 update was the cause for your issue. I have three devices all updated and they all show the Import To drop menu in Image Capture as shown below.

Maybe you are looking for

  • How do I restore my ipod to factory settings, but I have a passcode lock, and my screen is broken so I can't type in my password when I connect to itunes?

    Okay so I have had my ipod 4th gen for almost 2 years buy the screen has fallen out of the back casing, (I bought it as refurbished) and I am trying to reset it to factory settings, so when I get a new one I can register my device on apps/games since

  • Error when releasing billing to accounting document

    Why we tried to release the billing to accounting document. There is the below error. Could someone please kindly help? Message Identification: F5 System Message Number: 358 Output type: E The Diagnosis is 'This document refers to a document which co

  • Vision M: Need Help Deparately: Can't Inst

    Well I just bought my Vision M today, and tomorrow I'm heading to the beach. So I wanted to get all my music and videos on it for the trip, but wouldn't you know it, my CD dri've won't open. I've declared it dead. So now?how am I supposed to install

  • I can't configure elan touchpad after service

    Hi! My laptop is G580, i7. OS: Windows 8.1. After service (touchpad change), I can't configure the new one. I tried with different drivers - installing and uninstalling - nothing has change. "Options" in "ELAN" tab doesn't work.... When I start progr

  • JTextPane and Unicodes

    Hi, I am using unicodes in JTextPane yes it is working well but it does not suport some of them. I mean it doesnt show some of codes but it displays box at that place. So what should i do. When I press a key with the especial unicode character it als