Problem in displaying images

Dear JSP/Servlet experts,
I have problem in displaying images on a JSP page. I stored all the images names in a database and
try to retrieve them based on the user selection. When the JSP page is load for the first time the
following error occur but the images are displayed correctly:
2002-08-07 04:40:15 - Ctx( /simple ): IOException in: R( /simple + /images/cover150.jpg + null) Connection aborted by peer: socket write error
2002-08-07 04:40:15 - Ctx( /simple ): IOException in: R( /simple + /images/cover154.jpg + null) Connection aborted by peer: socket write error
2002-08-07 04:40:15 - Ctx( /simple ): IOException in: R( /simple + /images/cover152.jpg + null) Connection aborted by peer: socket write error
2002-08-07 04:40:15 - Ctx( /simple ): IOException in: R( /simple + /images/cover151.jpg + null) Connection aborted by peer: socket write error
2002-08-07 04:40:15 - Ctx( /simple ): IOException in: R( /simple + /images/cover156.jpg + null) Connection aborted by peer: socket write error
Here is the code to display the images(the getCover() method will return cover150.jpg, cover151.jpg.... )
and the images are stored in /simple/images folder
<td><a href="<img src="/simple/images/<%= b.getCover() %>" alt="details"></td>

try this
<img src=/simple/images/<%=b.getCover() %>
vasanth

Similar Messages

  • Problem in displaying images one by one in JList

    I have a problem in displaying images one by one in Jlist. I want to show 100 images as a thumbnailview in jlist but it is talking too much time to show all the images after scalling 100 images to thumbnail view and making it into ImageIcon. So, i thought that it would be better way to show one by one after scaling it into thumnailview. But my renderer is getting calling after 100 images scaled down and setting into list. I have posted my code 2 days back but there is no reply.
    http://forum.java.sun.com/thread.jspa?threadID=789943
    I donno where i am missing in this code.
    Plz suggest me some solution for it.

    Where is the scaling done? In the ListCellRenderer? Regardless of where that is being done, I assume you are caching the scaled images after you scale them, right? If not, consider adding some sort of caching.
    This should do the trick...
    Rework your ListCellRenderer to check to see if a scaled version of the image is available. If not, start a thread to do the scaling and create an ImageIcon. In the meantime, while that thread is running, have the renderer return some sort of stock icon, like a little generic image icon. When the scaling thread completes, make a call to repaint() on the JList so the cell renderer gets re-asked for the icons. This time around, the renderer should notice that a scaled version (the ImageIcon) is available. Return that. So, this method doesn't guarantee that the images will be produced in order, 1...2...3..., but it will return images as they become available, and the overall JList rendering won't wait until all 100 are ready. If you want them returned in order, just do all of the scaling in a single thread and queue up the images to be scaled, in order.
    I hoped this helps. (If it does, please throw me some Duke Dollars.)

  • Problem with displaying image

    Hello!
    Sorry, I'm a beginner in APEX and have some problems with displaying images in my application. I have read the same topic but unfortunately didnt find the solution.
    So.. I have the interactive report
    table test (
    NAME NOT NULL VARCHAR2(4000)
    ID NUMBER
    BLOB_CONTENT BLOB
    MIME_TYPE VARCHAR2(4000))
    I need to display the column blob_content.
    Thnks a lot.

    1009316 wrote:
    Hello! Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your forum profile with a real handle instead of "1009316".
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    Sorry, I'm a beginner in APEX and have some problems with displaying images in my application. I have read the same topic but unfortunately didnt find the solution.
    So.. I have the interactive report
    table test (
    NAME NOT NULL VARCHAR2(4000)
    ID NUMBER
    BLOB_CONTENT BLOB
    MIME_TYPE VARCHAR2(4000))
    I need to display the column blob_content.This is described in the documentation: About BLOB Support in Forms and Reports and Display Image. There's an OBE tutorial that followed the introduction of declarative BLOB support in 3.1 as well.

  • Problem in displaying images stored in Blob variable

    Hi all,
    I have a requirement where i need to retrieve the image stored in Blob variable in DB and display the image in JSP page.
    I have written the below code to achieve this, it works fine
    In JSP, I am calling a action in the <img tag
    <img src='downloadPhoto.page?method=getPhotoInBytes&accessoryModelPictures.id.accessoryNumber=${photo.id.accessoryNumber}/> In my controller class
    InputStream inputStream=accessoryPicturesLOB.getPicture().getBinaryStream();
    byte[] theBytes = new byte[inputStream.available()];
    inputStream.read(theBytes);
    response.setContentType("image/jpg");
    response.getOutputStream().write(theBytes);But the problem is, *if i right click on the image and select save picture as option i get a error saying "The system cannot find the specified file "*
    Can you please tell me what is wrong in my approach/code
    Is there any better approach to display image that is store in Blob variable ?
    Please help on this.
    Thanks in advance.

    You need at least to set the filename in the content disposition header.

  • Problem with displaying images exported to PS

    This is slightly different than the post about TIFF files not displaying properly.
    In Aperture 1.2, when I exported an image to PS and did extensive work on it, and then saved back to Aperture, it would appear in Aperture just as it looked in PS when I saved it.
    However, in 1.5, that does not happen. After I save the image, and then go back to Aperture, all of the changes I made in PS don't appear! However, if I again open the image in PS a second time, it will change to the PS version even before the image gets to PS (I can see it change right when I click "open with external editor").
    Is this a difference with how 1.2 and 1.5 handle the files? I'm guessing it has something to do with image previews, because I chose not to have Aperture generate previews when I installed 1.5 due to the slow-down issues I saw reported here.
    I'm starting to wonder what the point of upgrading to 1.5 was for me... if I can't take advantage of previews (accessing my Aperture library from other apps like Keynote, etc) and if the PS files I work on don't display properly, I'd rather go back to 1.2. This is a major problem in my workflow, since I often spend a lot of time working on images in PS, and I need to be able to see them that way when I return to Aperture.
    I'm hoping there's some setting somewhere I can use to fix this. Is there?

    David,
    I really appreciate your offer to help. However, I have the problem with all images in my library in all projects, so I'm not sure how useful it would be for you to work with a single image I upload to a server.
    I'm having the same problem on my MacBook too, though for some unknown reason there are certain projects on my MacBook that the process works fine with. I cannot tell any difference between those projects (that work) and those that don't.
    What's even more strange... if I quit Aperture, and re-open it, and then go through the process (open a file in PS2, save, return to Aperture) - it works fine! But ONLY ONE TIME. If I try the same process again, on that same image, or any other image in my library, it will not work. It only works the FIRST TIME I do it after opening Aperture. I tested this several times and got the same result.
    I am completely stumped here. I've tried generating previews for a project and turning all of the preview options on, but that doesn't solve the problem either.
    Anyone out there have a clue what might be happening? This is more than a minor inconvenience... if my image management system can't display the image as it should appear, it's unusable.
    Chris

  • Problem for displaying image in jsp

    I like to retrieve and display image from database in jsp file. Now, image has been retrieved and store in session. But it cannot be displayed in jsp. Who can help me? Thanks a lot!
    Codes like below:
    <%
    byte[] b = (byte[])session.getAttribute("sessionName");
    System.out.println(b.length); //the length can be printed at console successfully
    if(b != null) {
    response.setContentType("image/*");
    OutputStream toClient=response.getOutputStream();
    toClient.write(b);
    toClient.flush();
    toClient.close();
    %>

    JSP is designed to return text/html documents.
    As such it automatically calls getWriter() to return a character stream. (places it in the implicit variable "out"
    Seeing as you want to return bytes, instead of character data, the JSP technology is not applicable
    Calling getOutputStream after getWriter has been called results in an IllegalStateException
    So calling getOutputStream in a JSP will ALWAYS throw an exception.
    Cheers,
    evnafets

  • Problem in displaying image when running a jad file

    I have written a midlet which displays an image in the welcome screen and then shows the main menu for the application. WHen I try to run the code directly from the console by using the command "midp -classpath . teledoc", the code runs fine and also displays the image which is stored in the same directory as the class files. Now i made a jad file so that i can install it on the mobile phone directly but while running the jad file it gives an error that "unable to locate and read the png file". Can anyone tell me why it is happening. I am attaching the code for the midlet below. Also the jad and manifest.txt files are attached.
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    import java.io.*;
    public class teledoc extends MIDlet implements CommandListener{
    private Display display;
    private List list;
    private frmreg frmsub;
    private frmconsult frmsub1;
    private frmread frmsub2;
    private frmread_con frmsub3;
    private Command cmdexit;
    private Command cmdexit1;
    private Command cmdreg;
    private Command cmdconsult;
    private Command cmdread;
    private Alert altest;
    public teledoc(){
    display=Display.getDisplay(this);
    frmsub = new frmreg("New Registration", this);
    frmsub1 = new frmconsult("New Consultation", this);
    frmsub2 = new frmread("Select User", this);
    frmsub3 = new frmread_con("Select User", this);
    try{
         Image imgmain=Image.createImage("/teledoc.png");
         Image im1[] = {Image.createImage("/teledoc1.png"),Image.createImage("/teledoc1.png"),Image.createImage("/teledoc1.png"),Image.createImage("/teledoc1.png"),Image.createImage("/teledoc1.png"),Image.createImage("/teledoc1.png")};
         String options[] = {"New Registration", "Edit User Info", "New Consultation", "Edit Consultation", "Doctor's Reply", "Exit"};
         list = new List("Main Menu", List.IMPLICIT, options, null);
    cmdreg=new Command("New Registration", Command.SCREEN,3);
    cmdconsult=new Command("New Consultation", Command.SCREEN,4);
         cmdread=new Command("Edit User Info", Command.SCREEN,5);
         cmdexit1=new Command("Exit", Command.SCREEN,6);
    cmdexit=new Command("Exit", Command.SCREEN,2);                    list.addCommand(cmdexit1);
    list.setCommandListener(this);
    catch(java.io.IOException e)
    System.err.println("unable to locate");
    public void startApp(){
    try{
    Image im=Image.createImage("/teledoc.png");
    altest = new Alert("Welcome to TeleDoc", "", im, AlertType.INFO);
    altest.setTimeout(2000);
    catch(Exception e){
    System.out.println("Unable to Read PNG Image :");
    displayteledoc1();
    public void displayteledoc()
    display.setCurrent(list);
         public void displayteledoc1()
    display.setCurrent(altest, list);
    public void commandAction(Command c, Displayable s){
    //if(s==list){
    if(c==list.SELECT_COMMAND){
              switch (list.getSelectedIndex())
              case 0:
    display.setCurrent(frmsub);
              break;
              case 1:
    display.setCurrent(frmsub2);
              break;
              case 2:
    display.setCurrent(frmsub1);
              break;
              case 3:
    display.setCurrent(frmsub3);
              break;
              case 4:
              break;
              case 5:
    destroyApp(false);
              notifyDestroyed();
              break;
    if(c==cmdexit1){
    destroyApp(false);
    notifyDestroyed();
    //manifest.txt file
    MIDlet-Name: teledoc
    MIDlet-Version: 1.0
    MIDlet-Vendor: Jiva Research Institute.
    MIDlet-1: teledoc, /teledoc.png , teledoc
    MicroEdition-Profile: MIDP-1.0
    MicroEdition-Configuration: CLDC-1.0
    ////teledoc.jad file
    MIDlet-Name: teledoc
    MIDlet-Version: 1.0
    MIDlet-Vendor: Jiva Research Institute.
    MIDlet-Jar-URL: teledoc.jar
    MIDlet-Jar-Size: 18546
    MIDlet-1: teledoc, /teledoc.png , teledoc

    The problem probably isn't in you code, nor manifest nor jad file, but in the package process. Your image have to be in the root dir of the .jar file, but it isn't there. Try to see what is in you .jar with your favourite compress tool or with this command:
    %JAVA_HOME%\bin\jar -tfv <yoursuite.jar>

  • Problem in displaying image on jsp page

    I want to display an image on jsp page.I copied the image the image in WebContent folder.
    I am able to see the image on the design pane when using the following code:-
    <img src="/image.gif" height="50" width="50"> but when i run it in the browser nothing gets diplsyed.
    also when i use the image container and select the source option that image is not displayed in the WebContents file..plz help.

    Hi,
    Seems that the Problem is there with the way how you specifuied the Image relative Path:
    You have specified the below: The opath of image starts with (/) forward slash:
    *<img src="/image.gif" height="50" width="50">*
    It means to access this Image WebLogic Container will form a Path like this:
    http://localhost:7001/image.gif
    BUT may be the image is available inside your Context root: So Change the <Img> tag like following in your JSP:
    *<img src="image.gif" height="50" width="50">*
    (*NOTE:* Never Start your src path with a Preceesing /)
    Now WLE will consider the path like below ..if your Applications Context root is "TestApp"
    http://localhost:7001/TestApp/image.gif
    I am Assuming that Inside the TestApp Application "image.gif" And "your.jsp" jSP pages are Co-Located (Means available in the Same Directory).
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com (WebLogic Magical Stuff)

  • Problem in displaying image

    Hi All,
    I have an image in my view.
    I have stored images under ../src/mimes/component/com... folder.
    I am able to view the images in design time.
    In runtime the images are displaying as a small red x.
    What is the problem and how do i solve it?
    Thanks

    Hi,Tiruna Shanmuga
           I had encountered the same problem .  you might delete all the internet temprary  file in "internet option" in  your browser.  after done it  , i am sure you would see the same situation with your runtime . afterwards , you should find where is your problem .

  • Two problems with displaying images in JPanel

    Hi,
    I need to display some small rectangular images inside a JPanel. These images also need to be componenents as they will have listeners associated with them. I have never had any experience with images, so I might totally be down the wrong path. I was thinking of just creating a class which extends JComponent, and using the graphics drawImage method. However, I don't want each image component to have to know exactly where to draw the image associated with itself. Rather, I want the JPanel which holds all of the images to know how to lay them out.
    Is there an easier way to use images?
    Which brings me to my second problem. I want these images to overlap each other, so that only a small portion of each is showing (this way I can fit more on the screen), then when the user clicks on one, I can show more of it.
    Unfortunately, I don't know of any layout managers which will allow me to overlap components. I could use the drawImage method mentioned above, but like I said, I would like to try to not have each image object try and figure out its location.
    any help is greatly appreciated. Thanks!

    Hi
    there is a better way ; it is called a JLabel ;-)
    JLabel myJLabel = new JLabel(new ImageIcon("img/myLogo.gif"));for your second problem, don't use any layout manager like in this code :
    myJPanel.setLayout(null);
    myJPanel.add(myJLabel);
    myJLabel.setBounds(new Rectangle(x, y, width, height);hope it helps
    Nico

  • Problem in Displaying image in HTML format for BI Publisher (OTM)

    Hello,
    We are using OTM 6.2 and we are developing the IB reports to the customer.
    I am getting dificulty while displaying the image in HTML format. I used image in JPEG format. When i am running the report, It displayed only in PDF format, but not in HTML and Excel format.
    Please do the needful help in this regards.
    Thanks & Regards,
    Siva Donthi

    Hi Kavipriya,
    i have gone thru all your threads on a similar sort of issue which i am facing now, However i m bit struck as i m newbie.
    Issue:i am insering a static picture from the c drive into the header section of the rtf template and when previewing the rtf template on the BI publisher the jpg image disappears. i have tried adding the url into the format picture -->alt tab.Still no signs of improvement.
    However if just placing the jpg image on header section without using the wrap text it gets displayed.But if i use wrap text on the image ,it disappears.
    could you guide me please in fixing this issue .
    Appreciate your timely response and your co-operation
    Thanks
    Joe

  • Problem to display image from database

    i also waiting when this practical will come to the end la..really boring..mrhanafi came 2 weeks ago..he didnt check anyhting..he was there for 15 mins only..hey dont play ponteng la..after this friday you ponteng how many days you want;)

    Using JHeadstart, you can display a BLOB column from the database in HTML, by way of ADF. Check out the JHeadstart Tutorial at http://www.oracle.com/technology/products/jdev/tips/muench/jhstutorial/index.html to get started, then do the same for your own database tables that include the BLOB column. JHeadstart will take care of rendering it as a file upload or image, depending on the display type you set at the attribute level.
    Hope this helps,
    Sandra Muller
    JHeadstart Team
    Oracle Consulting

  • Problem to display image on report

    Hi,
    I have an image on a differnt server owned by different group. And I need to bring that image and display it on the report. Is this possible? Can some one hlep me how to do this?
    It was working fine in reports 2.5 but we migrated to 10g and it stopped working.
    Thanks in advance.

    Hi,
    you can embed the image in your oracle report when you give the image item the URL of the image.
    The image item in your report MUST NOT be horizontally or vertically flexible it must have a fixed height and width.
    regards

  • Problem in displaying images on handset

    Hi all,
    My code consists of displaying a set of J2ME images, i have used different forms for displaying different images.
    It worked fi9 on emulator, but when i loaded its jar file on Nokia 6600 handset, i am unable to see the images.
    Though application's name is visible.Bit depth is 24 and image format is .png. The code is as follows :
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import java.util.*;
    public class testMIDlet extends MIDlet implements CommandListener
    private final Command exit = new Command("Exit", Command.OK, 1);
    private Form form1;
    private Form form2;
    private Form form3;
    private Form form4;
    private Form form57;
    private Display display;
    private ImageItem imageItem;
    public void startApp()
    System.out.println("In startApp .....");
    display = Display.getDisplay(this);
    //Create the form with a title
    form57 = new Form("Wayfinder Application");
    //Image and ImageItem
    try {
    Image image = Image.createImage("/57.png");
    form57.append(image);
    display.setCurrent(form57);
    try{
    Thread.sleep(500);
    catch(InterruptedException IE)
    System.out.println("exception caught");
    form1 = new Form("Wayfinder Application.");
    image = Image.createImage("/1.png");
    form1.append(image);
    display.setCurrent(form1);
    try{
    Thread.sleep(500);
    catch(InterruptedException IE)
    System.out.println("exception caught");
    form2 = new Form("Wayfinder Application.");
    image = Image.createImage("/2.png");
    form2.append(image);
    display.setCurrent(form2);
    try{
    Thread.sleep(500);
    catch(InterruptedException IE)
    System.out.println("exception caught");
    form3 = new Form("Wayfinder Application");
    image = Image.createImage("/3.png");
    form3.append(image);
    display.setCurrent(form3);
    try{
    Thread.sleep(500);
    catch(InterruptedException IE)
    System.out.println("exception caught");
    form4 = new Form("Wayfinder Application");
    image = Image.createImage("/4.png");
    form4.append(image);
    display.setCurrent(form4);
    try{
    Thread.sleep(500);
    catch(InterruptedException IE)
    System.out.println("exception caught");
    catch (java.io.IOException e) {}
    display.setCurrent(form57);
    public void pauseApp()
    System.out.println("In pauseApp .....");
    public void destroyApp(boolean unconditional)
    System.out.println("In destroyApp .....");
    public void commandAction(Command c, Displayable disp)
    if (c == exit)
    destroyApp(false);
    notifyDestroyed();
    Message was edited by:
    zibba

    Wrong forum. This is the forum for java sound.

  • Problem when displaying images when working  with PHP, mysql and dreamweaver in a brower

    Hey Guys
    I am new to dynamic development but I already did some
    research and tutorials about how to get a dynamic web site working
    with PHP and Mysql in Dreamweaver. I set up a test page to view
    some content on it directly from the mysql database and it worked
    just fine in dreamweaver only when I pressed the
    live data view.
    When I tried to view the same page using the browser preview
    with firefox and internet explorer, plain text from the database
    was correctly displayed on the brower but the images were absent.
    In the mysql database I used the varchar as my picture data
    type field so that I will refer in dreamweaver in the data binding
    panel in the img.src to the picture column of my database.
    I anyone can tell me what am I doing wrong so that my
    pictures are not displayed in the browser when i click the browser
    preview facility in dreamweaver I would be very very and very
    pleased ! :)

    The odds are that it is the way that you have referenced the
    images rather
    than an issue with the database. If you have the images root
    relative like
    this "/images" then they will work in preview, and on the
    webserver, but
    will not view when looking at the file via localhost.
    If possible make the links page relative and then they should
    work fine.
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "mariosal026" <[email protected]> wrote in
    message
    news:ea3nq2$9ol$[email protected]..
    > Hey Guys
    >
    > I am new to dynamic development but I already did some
    research and
    > tutorials
    > about how to get a dynamic web site working with PHP and
    Mysql in
    > Dreamweaver.
    > I set up a test page to view some content on it directly
    from the mysql
    > database and it worked just fine in dreamweaver only
    when I pressed the
    >
    live
    > data view.
    >
    > When I tried to view the same page using the browser
    preview with firefox
    > and
    > internet explorer, plain text from the database was
    correctly displayed on
    > the
    > brower but the images were absent.
    >
    > In the mysql database I used the varchar as my picture
    data type field so
    > that
    > I will refer in dreamweaver in the data binding panel in
    the img.src to
    > the
    > picture column of my database.
    >
    > I anyone can tell me what am I doing wrong so that my
    pictures are not
    > displayed in the browser when i click the browser
    preview facility in
    > dreamweaver I would be very very and very pleased ! :)
    >

Maybe you are looking for

  • Trying to install app from App Store results in "An error has occurred."

    I am trying to update TextWrangler in the OSX App Store application. Multiple attempts to update have resulted in the same error. This appears to be also happening with other apps (Pages, in particular), but for the moment I will keep troubleshooting

  • Message Interface not found during Receiver determination

    Hi Folks, While doing Receiver determination i found this error “Problem Loading Schema Description: Message interface does not exist in any software components installed on this business system” i checked it in SLD also for Product assigned to Parti

  • What audio format is best to encode my CDs?

    Its a tough question for me to answer because I want something better then a mp3 but not as much as a .wave file, get my drift? So out of the 5 options of AAC, AIFF, Apple Lossless, MP3, WAV, do most people like to use when its played on a pretty goo

  • Downloading online, instead of disc bought edition?

    I bought an education edition of Adobe Creative Suit and acrobat X1 Pro, but my CD ROM drive is not working.  Is there anyway I can download the programs and enter my seial numbers online?

  • Lvm time column negative value

    Hi, I have made a simple data logger to write temperature and pressure values to a lvm file using the write lvm express vi in labview 7. I works ok but the time column in the lvm file does not start at zero but begins with a negative value. There is