Displaying an image through a servlet

Hi I have a problem here. I just want to upload an image to a Server and show the same image as a response to the client. I am using Apache's request parser and able to get the file stream from the request. Then what can i do to show the image on IE as a response.

Thanks a lot,
After refering your blog I am able to solve my problem. What I have done for my problem is.
1. I have created a servlet to create a file with the uploaded jpg file strem.
2. then created an HTML code in the same servlet. In the code i have used an image tag with src=ImageServlet?file="file_I_have_created_from_stream".
3. In that image servlet i have just write the file stream to response and returned.
I hope that u understood.
Here I got another problem. In the browser it still showing that data is transfering from server. and a busy cusrsor is showing up. What I need to do to commit the output.

Similar Messages

  • Displaying an image in jsp / servlet

    Hi, I am trying to display an image from database to be displayed in the servlet
    following is my code
    package image;
    import java.io.*;
    import java.text.*;
    import java.util.*;
    import java.sql.*;
    import java.awt.*;
    import java.awt.image.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.PrintWriter;
    import com.sun.image.codec.jpeg.*;
    public class BlobImageServlet extends HttpServlet
    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    String idStr="";
    String buffString="";
    InputStream is;
    byte[] buffer=null;
    Connection conn = null;
    //Statement stmt =null;
    CallableStatement stmt;
    ResultSet rs;
    //BlobStudentInfo bInfo = null;
    //Class.forName("com.sybase.jdbc2.jdbc.SybDriver");
    //idStr = (String)request.getParameter("id");
    //bInfo = (BlobStudentInfo)request.getAttribute("binfo");
    try {
    //stmt = conn.getConn().createStatement();
         Class.forName("com.sybase.jdbc2.jdbc.SybDriver");
         conn = DriverManager.getConnection("jdbc:sybase:Tds:dbserv.com.xyz.edu:4444/mydb","user","pwd");
         stmt = conn.prepareCall("{call dbo.getimage(?)}");
         stmt.setInt(1,10);
         stmt.execute();
    stmt.getMoreResults();
    rs = (ResultSet) stmt.getResultSet();
    while (!rs.isFirst()) {
    rs.next();
    buffer = rs.getBytes("image");
    // rs = stmt.executeQuery("select image from photo where indexing =10");
    if (rs.equals(null)){
         System.out.println("Resultset is not null");
    }else System.out.println("RS is not null");
    //while (rs.next());{
         // buffer = rs.getBytes("image");
    stmt.close();
    rs.close();
    //conn.closeConnection();
    } catch(SQLException sqe){
    while (sqe != null) {
    System.out.println("BlobImageServlet: SQLException: " + sqe.getMessage());
    //e.printStackTrace();
    sqe = sqe.getNextException();
    } catch (Exception e) {
    System.out.println("BlobImageServlet: Exception !!");
    e.printStackTrace();
    //buffer = bInfo.getHeadshot();
    JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(new ByteArrayInputStream(buffer));
    BufferedImage image = decoder.decodeAsBufferedImage() ;
    response.setContentType("image/jpeg");
    // Send back image
    ServletOutputStream sos = response.getOutputStream();
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(sos);
    encoder.encode(image); // writes the image to browser
    } //doPost closed
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException
    doPost(request, response);
    and the corresponding procedure is
    create procedure dbo.getimage
    @indexing int
    as
    select image from dbo.photo where indexing = @indexing
    Whenver I try to run the servlet as http://localhost:8080/Test/BlobImageServlet
    I get null pointer exception
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    java.lang.NullPointerException
         java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:89)
         image.BlobImageServlet.doPost(BlobImageServlet.java:72)
         image.BlobImageServlet.doGet(BlobImageServlet.java:86)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.
    Please let me know if you have any questions.

    When we see the following code
    response.setContentType("image/jpeg");
    we can only view the images from database that were stored of jpeg but not of gif.
    Like gif images stored in binary format doesnt allow us to view back the images instead give some exceptions like
    com.sun.image.codec.jpeg.ImageFormatException: Not a JPEG file: starts with 0x42 0x4d
         sun.awt.image.codec.JPEGImageDecoderImpl.readJPEGStream(Native Method)
         sun.awt.image.codec.JPEGImageDecoderImpl.decodeAsBufferedImage(JPEGImageDecoderImpl.java:210)
         image.BlobImageServlet.doPost(BlobImageServlet.java:67)
         image.BlobImageServlet.doGet(BlobImageServlet.java:80)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    If I have to veiw a gif image from the database it doesnt allow me to do so giving jpeg exceptions.
    I have put a javascript asking the uploaders to load only jpeg files.
    but i would be happy if it was generic. Is there any solution.
    Regards
    Sandeep.

  • Displaying an image in an applet

    hi there - can anyone tell me why the following code only displays the image through the applet viewer but when i load it in a browser it just displays a grey square the same size as the image i'm trying to load?! many thanks.
    import java.awt.*;
    import javax.swing.*;
    import java.net.*;
    public class DisplayImage extends JApplet
         public void init()
              ImageIcon icon = null;
              try
                   icon = new ImageIcon(new URL(getCodeBase(), "map.jpg"));
              catch(MalformedURLException e)
                   System.out.println("Failed to create URL:\n" + e);
                   return;
              int imageWidth = icon.getIconWidth();
              int imageHeight = icon.getIconHeight();
              resize(imageWidth, imageHeight);
              ImagePanel imagePanel = new ImagePanel(icon.getImage());
              getContentPane().add(imagePanel);
         class ImagePanel extends JPanel
              public ImagePanel(Image image)
                   this.image = image;
              public void paint(Graphics g)
                   g.drawImage(image, 0, 0, this);
              Image image;

    Rat fans!

  • Store Image through Servlet

    I want to store a JPG image into database column through Servlet
    and dispaly it on a JSP page through Beans
    how can i ?

    Any requests made to a JSP are of a certain content. Generally you make a request to a JSP page it sends back a "text/html" document. There is noi binary data as such just text.
    Images on a page are displayed because the "src" attribute of the image tag points to a server location. This in turn returns content of type "image/*".
    A servlet can retrieve/generate your images for you for example you could point to a servlet:
    <img src="/system/imageServlet">
    I guess a JSP can do the same (I've never tried it) just remember to set the response.contentType to "image/gif"/"image/jpg".....
    Cheers,
    Anthony

  • I want to display the image with the help of servlet by specifying the url

    hi all,
    I am getting the Image from the Server to the Servlet (when i am using the physicalAddress ie c:/programfiles/......)it was getting the image but at the same time it was not displaying the image when i am using the URL address(ie http://localhost:8080/....)it was not displaying the image.
    I don't know what the problem is...what is the problem?
    can anybody give me the suggestion for fixing that.
    thanks in advance
    lakshman

    Hi,
    Invoice you will have the Purchase Order no. Display the purchase order through ME23N and at the item details you can find the GRN No. Or double click on the purchasing doc no. system will display the PO.
    Thanks
    VK

  • Garbled images when passed through faces servlet

    hello.
    I have pages whose image get completely garbled if they are displayed using the /faces/blaah.jsp path, but are not if displayed as /blaah.jsp
    whatever the browser and the method to display them, they are always destroyed when the servlet routes them.
    I googled here and there but found nothing about it.
    Is it a known problem?
    Thanks.

    Nope, never heard of such a problem. That's very strange.
    Are there any weird coincidences, such as the image name being the same as a faces page name. i.e. blaah.jsp and blaah.gif. And perhaps you are somehow routing the image through the faces servlet as well. i.e. /faces/blaah.gif instead of /blaah.gif.
    Beyond that... Some details on your JSF version and a code snippet of how you are displaying your image will help.
    CowKing

  • 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 to display image through script

    Hi,
    In my template I am passing image path through xml, I need to display this image on XDP template.
    Please help for the same,
    I tried
    ImageField1.resolveNode("value.#image").href = "C:\\logo.jpg";
    Image1.resolveNode("value.#image").url=".\logo.jpg";
    But it doesn't help, Is I am doing any mistake or is there any other way.
    Thanks,
    Abhijit

    Got the solution,
    first need to convert the imge into base 64 encoded string, and then pass it through xml.
    do the binding with imageField, and make it readonly.
    To covert image into base4 use below code
    //convert image file into byte array this case - buf
    String base64EncodedStr =
    new sun.misc.BASE64Encoder().encode(buf);

  • HT201300 What cable should be used to connect a macbook pro, 13 inch early 2011 model to an external projector so it will display the computer screen image through the projector?

    What cable should be used to connect a macbook pro, 13 inch, early 2011 model to an external projector so the project displays the image on the computer screen?

    You will need a cable or adapter with a minidisplay connection for the MBP.  That will be inserted in the Thunderbolt port.  The other end is dependent upon the connections of the projector which you have not listed.
    Ciao.

  • How to display images on a servlet generated page???

    Hi, I am developing an app in which I must display some messages, each message may have an image. The images are saved in the database. I do not want to save the image on the filesystem but instead of that I want to send the image as an attribute to the page but I dont know then how to display it. I have no idea about how to do that! Any help on this would be very appreciated!

    mmm yes I know that the img tag displays an image but I am asking how to display the image without saving the file into the server filesystem, I mean something like:
    1.- getting the bytes from the Database
    2.- getting an Image object
    3.- pasing it to the request as an attribute
    4.- getting that attribute from the request
    5.- displaying it on somehow directly from the image var or something.
    the src parameter of the img tag takes as a string the path of the image, but i dont want to save it.

  • Problem in getting the image through URL

    hi all,
    I facing the problem,Inwhich i am unable find the solution...I am using the following code to display the image
    public void doGet(HttpServletRequest request,HttpServletResponse response)
                        throws IOException, ServletException {
                   int data=0;
                   response.setContentType("image/png");
                   ServletOutputStream out = response.getOutputStream();
                   String file = request.getContextPath()+imageNames[0];
                   //String file = "C:/Program Files/Apache Group/Tomcat 4.1/webapps/ImageComm/WEB-INF/images"+imageNames[index];
                   BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));
                   System.out.println("the size of the inputStream is..."+in.available());
                   System.out.println("the context path is..."+request.getContextPath());          
                   while ((data = in.read()) != -1) {
                   out.write(data);
    with the above i am not getting any error at the compile time but it was giving exception like FileNotFoundException.
    but the same thing(URL address) when i am copying on the browser it was displayig the image.
    (what might be the reason)
    one more thing when i commented on the url address and try to use the actual realpath address it was displaying the image with out any problem
    can anybody give me the solution like where to keep my images by which i can able to get the images through url address
    thanks in advance
    lakshman

    hi all,
    I am getting the image from the server.but the problem is i am getting the Exception as ArrayOutOfBound exception.
    It was displaying the Image for the first time.and when ever it was going for the second time in to the paint method it was displaying the IOException in reading the stream from the connection.
    can anybody give me the solution in rectifying that exception.
    thanks in advance
    lakshman

  • How can I display three images in video rate succession (60 Hz)?

    For a structured illumination microscope application, I have developed a VI that creates three images and displays them in rapid succession (as fast as the loop will go) on a second monitor.
    From the naked eye it's pretty apparent that the loop is not displaying the images at video rate.  Is there a way (perhaps with some sort of buffer) to get them to display faster?  Is WinShow simply not going to be fast enough, and if not, what's an alternative method of displaying the images?  If it helps, the images need only be displayed once each (the loop was just for testing).
    Also, what is a way to measure the frame rate output of the images?
    (sorry for the sloppy code, new to LabView)
    Thanks,
    -T
    Attachments:
    illuminationpattern.vi ‏31 KB

    Hello,
    Why don't  you try drawing one window, call IMAQ WindShow once outside of the loop, then redraw that window each iteration within the loop.  Hopefully this stops the flutter of the window.  You can build a 3 element array of the 3 IMAQ images then use an index array to alternate through which image you want to be redrawn into the single window.  The constant calling of IMAQ WindShow seems messy.
    Regards,
    Isaac S.
    Applications Engineer
    National Instruments

  • How to display uploaded image in jsp page.

    Hello,
    I am using struts 1.2.9 and and have uploaded image on the server. Now what I want to do display the image in jsp page after clicking on one link in jsp. I have tried many thing to display image in jsp page. But I am getting an error during displaying image in jsp. I have displayed absolute path in servlet. and used InputStream and outputstream to display image in jsp page.
    Can any one help.
    Thanks in advance
    Manveer Singh

    Follow this. This topic is very popular recently on the forum.

  • Getting error while updating property of image through weblogic CMS

    Hii
    I want to add alt text and alt title to an existing image through Weblogic Content Management System_ . For that I have used adAltText property of ad content type.
    For that I have refer the following link
    [ http://docs.oracle.com/cd/E13155_01/wlp/docs103/cm/contentTypesCm.html#wp1096390]
    I add values to adAltText. After that clicked on cheach in.
    But while doing cheach in in Weblogic Content Management System_ . I am getting following Exception
    A RepositoryException was thrown: null
    and following is stacktrace:
    com.bea.content.virtual.workflow.WorkflowException
         at com.bea.content.virtual.workflow.PublishAction.execute(PublishAction.java:179)
         at com.bea.content.virtual.internal.server.bean.InternalWorkspaceOpsBean.handleWorkflowActions(InternalWorkspaceOpsBean.java:524)
         at com.bea.content.virtual.internal.server.bean.InternalWorkspaceOpsBean.internalCheckIn(InternalWorkspaceOpsBean.java:420)
         at com.bea.content.virtual.internal.server.bean.InternalWorkspaceOpsBean.checkIn(InternalWorkspaceOpsBean.java:343)
         at com.bea.content.virtual.internal.server.bean.WorkspaceOps_xe5vix_ELOImpl.checkIn(WorkspaceOps_xe5vix_ELOImpl.java:166)
         at com.bea.content.virtual.internal.WorkspaceOpsImpl.checkIn(WorkspaceOpsImpl.java:90)
         at com.bea.content.federated.internal.VersionManagerImpl.checkIn(VersionManagerImpl.java:239)
         at com.bea.portal.tools.content.controls.ContentVersionControlImpl.checkIn(ContentVersionControlImpl.java:165)
         at com.bea.portal.tools.content.controls.ContentVersionControlBean.checkIn(ContentVersionControlBean.java:839)
         at content.BaseContent.doCheckinLatestVersion(BaseContent.java:1127)
         at content.BaseContent.handleLibraryOpForSelectedNode(BaseContent.java:1050)
         at content.node.nodeSelected.properties.NodePropertiesController.checkInLatestVersion(NodePropertiesController.java:530)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:879)
         at org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:809)
         at org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:478)
         at org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:306)
         at global.internal.AbstractBaseController.internalExecute(AbstractBaseController.java:360)
         at org.apache.beehive.netui.pageflow.FlowController.execute(FlowController.java:336)
         at org.apache.beehive.netui.pageflow.internal.FlowControllerAction.execute(FlowControllerAction.java:52)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
         at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:97)
         at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java:2044)
         at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors.wrapAction(ActionInterceptors.java:91)
         at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java:2116)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
         at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:556)
         at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:853)
         at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:631)
         at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:158)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
         at org.apache.beehive.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1199)
         at org.apache.beehive.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1129)
         at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.executeAction(ScopedContentCommonSupport.java:687)
         at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.processActionInternal(ScopedContentCommonSupport.java:142)
         at com.bea.portlet.adapter.scopedcontent.PageFlowStubImpl.processAction(PageFlowStubImpl.java:107)
         at com.bea.portlet.adapter.NetuiActionHandler.raiseScopedAction(NetuiActionHandler.java:111)
         at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:181)
         at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:167)
         at com.bea.netuix.servlets.controls.content.NetuiContent.handlePostbackData(NetuiContent.java:225)
         at com.bea.netuix.nf.ControlLifecycle$2.visit(ControlLifecycle.java:180)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:324)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:130)
         at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:395)
         at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:361)
         at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:352)
         at com.bea.netuix.nf.Lifecycle.runInbound(Lifecycle.java:184)
         at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:159)
         at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:388)
         at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:258)
         at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:199)
         at com.bea.netuix.servlets.manager.SingleFileServlet.service(SingleFileServlet.java:251)
         at com.bea.netuix.servlets.manager.PortalServlet.service(PortalServlet.java:686)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at com.bea.jsptools.servlet.PagedResultServiceFilter.doFilter(PagedResultServiceFilter.java:82)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at com.bea.portal.tools.servlet.http.HttpContextFilter.doFilter(HttpContextFilter.java:60)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:336)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3502)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2186)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2092)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Please reply if any one find solution on this.
    Edited by: 925203 on Apr 3, 2012 6:34 AM
    Edited by: 925203 on Apr 3, 2012 6:35 AM
    Edited by: 925203 on Apr 4, 2012 10:41 PM

    Yes, I am using custom work flow.
    I added new property for alternate text to existing content type Banner. When I try to update value for alternate text it throws error: A RepositoryException was thrown: null
    Even if i try to delete added property it throws error :
    A RepositoryException was thrown: The type Banner has existing node instances. Therefore the removal of property definition alt is not allowed.
    Is there alternate way to add property to existing content type through weblogic content management console?
    Edited by: 925203 on Apr 5, 2012 9:48 PM

  • I want to display BLOB image in JSP Using  html tags IMG src=

    GoodAfternoon Sir/Madom
    I Have got the image from oracle database but want to display BLOB image using <IMG src="" > Html tags in JSP page . If it is possible than please give some ideas or
    Send me sample codes for display image.
    This code is ok and working no problem here Please send me code How to display using html tag from oracle in JSP page.
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="javax.swing.ImageIcon;" %>
          <%
            out.print("hiiiiiii") ;
                // declare a connection by using Connection interface
                Connection connection = null;
                /* Create string of connection url within specified format with machine
                   name, port number and database name. Here machine name id localhost
                   and database name is student. */
                String connectionURL = "jdbc:oracle:thin:@localhost:1521:orcl";
                /*declare a resultSet that works as a table resulted by execute a specified
                   sql query. */
                ResultSet rs = null;
                // Declare statement.
                PreparedStatement psmnt = null;
                  // declare InputStream object to store binary stream of given image.
                   InputStream sImage;
                try {
                    // Load JDBC driver "com.mysql.jdbc.Driver"
                    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
                        /* Create a connection by using getConnection() method that takes
                        parameters of string type connection url, user name and password to
                        connect to database. */
                    connection = DriverManager.getConnection(connectionURL, "scott", "root");
                        /* prepareStatement() is used for create statement object that is
                    used for sending sql statements to the specified database. */
                    psmnt = connection.prepareStatement("SELECT image FROM img WHERE id = ?");
                    psmnt.setString(1, "10");
                    rs = psmnt.executeQuery();
                    if(rs.next()) {
                          byte[] bytearray = new byte[1048576];
                          int size=0;
                          sImage = rs.getBinaryStream(1);
                        //response.reset();
                          response.setContentType("image/jpeg");
                          while((size=sImage.read(bytearray))!= -1 ){
                response.getOutputStream().write(bytearray,0,size);
                catch(Exception ex){
                        out.println("error :"+ex);
               finally {
                    // close all the connections.
                    rs.close();
                    psmnt.close();
                    connection.close();
         %>
         Thanks

    I have done exactly that in one of my applications.
    I have extracted the image from the database as a byte array, and displayed it using a servlet.
    Here is the method in the servlet which does the displaying:
    (since I'm writing one byte at a time, it's probably not terribly efficient but it works)
         private void sendImage(byte[] bytes, HttpServletRequest request, HttpServletResponse response) throws IOException {
              ServletOutputStream sout = response.getOutputStream();
              for(int n = 0; n < bytes.length; n++) {
                   sout.write(bytes[n]);
              sout.flush();
              sout.close();
         }Then in my JSP, I use this:
    <img src="/path-to-servlet/image.jpg"/>
    The name of the image to display is in the URL as well as the path to the servlet. The servlet will therefore need to extract the image name from the url and call the database.

Maybe you are looking for