Problem in loading images in JSP

Hi
My JSP page is loading few gif images.
I am running tomcat 4 connected to apache 1.3.22 using MOD_WEBAPP connector.
My JSP file loads perfectly alright when I load it directly from tomcat server that is port 8080.
But when I load it from apache that is port 80, it is taking very long time and not loading images.
Does anybody has (or had ) the similar problem?
Please help me
Thanks
Raji

I'm having the same problem displaying images when I call a jspt hrough Apache 2.0.39 from Tomcat 4.1.3.
I am using mod_jk as my connector through Apache.
Did you come up with a solution to displaying images when calling your JSP app through Apache?
Thanks
Lenny Sorey

Similar Messages

  • Problem in loading images when i am connected on company network

    Hi friends, I am using firefox since last 4 months on my windows 8 pro laptop.but since last month I am facing problem in loading images when i am connected on company network but same time it is working fine with ie10. But all these thinks are working well at my home when I am using broadband.

    I don't completely understand your issue. Does this issue occur on 1 network and does not occur on another? Have you tried clearing cache and cookies and making sure your plugins are up to date?
    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Did this fix your problems? Please report back to us!
    Please check if all your plugins are up-to-date. To do this, go to the [http://mozilla.com/plugincheck Mozilla Plugin Check site].
    Once you're there, the site will check if all your plugins have the latest versions.
    If you see plugins in the list that have a yellow ''Update'' button or a red ''Update now'' button, please update these immediately.
    To do so, please click each red or yellow button. Then you should see a site that allows you to download the latest version. Double-click the downloaded file to start the installation and follow the steps mentioned in the installation procedure.

  • Problem with Loading Images?

    <pre><i>Locking duplicate thread.
    Please continue here: [[/questions/982030]]
    </i></pre>
    Hi,
    I'm using Firefox 26.0 and I'm kinda new user to Firefox.
    I'm having this random issue with facebook (sometimes with other websites too),
    Sometimes when I open a page, the Images doesn't show as usual.
    Sometimes it takes up to 10sec - 2 mnts to finish loading all the images.
    My internet is 8Mbps so I don't think its due to that?
    Here is a screenshot of the exact issue: http://i.imgur.com/I3eOQaI.jpg
    But it get fixed for a while (say 1-2 days) if I clear the cookies and caches. I visits a lot of webpages so clearing cookies and caches all the times is kinda not pretty possible.
    I also tried disabling all my add-ons, and ran a full scan with McAfee.
    Can anyone tells me what exactly could be the issue? It gets pretty annoying sometimes!
    Thanks in advance!
    Regards,
    Abey

    '''Hi, Thanks for Visiting this Question. But it was a duplicate of https://support.mozilla.org/en-US/questions/982030 (The Same question) Accidentally posted twice''' and I couldn't find an option to delete it, so please '''ignore''' this :-)
    Original thread: [[https://support.mozilla.org/en-US/questions/982030|"Problem with Loading Images"]]
    Warm Regards,
    Abey

  • Problem with loading images dynamically in a pdf document

    dear,
         I am using live cycle designer and i need to load image from a url dynamically in to the document.For this case i placed an imagefield on my document and i wrote javascript to load image in the form:ready event.
    My script for that was
    imagefield.value.image.href="url".Actually i saw an imagefield in my document but it doesnt carry any image.Please help me to rectify this problem......

    If you save your form as Static PDF, it works.
    But most of the time we need the Dynamic XML form. So, I am also stuggling with this issue.
    Nith

  • 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 loading images.

    I am doing a project. I am creating a jar file which i can execute anywhere. I have some 30 class files in my project.
    i am creating jar file by this command
    jar cfm IBC.jar *i have not specified manifest file and then after i am modifying manifest file as
    Main-Class: Splashscreenwhere spashscreen is my main class.
    i have also added image files in my project.
    and jar file contains images.
    i have created the project using netbeans.
    when i build it creates a jar file also in dist directory.
    But when i try executing the file which i created manually then it gets executed but i cannot view the images on my forms.
    also the class files and image files are in src directory. When i place jar file in src directory and execute it shows images on form but when i change the directory it does not. What can be the problem. Same problem is with netbeans generated file also. Please help me!

    Hello there,
    To load images to Jars I recommend to you that you follow these methods
    JLabel label = new JLabel();
    ClassLoader cldr = this.getClass().getClassLoader();
    java.net.URL imgUrl = cldr.getResource(" -- img dir -- ");
    ImageIcon img = new ImageIcon(imUrl);
    label.setIcon(img); In this case the Jars files would make sure that it loads this images.
    Regards,

  • Problem in loading images at runtime

    hi ~
    I am facing some problem in making a dynamic flash
    application. Actually i have to loading certain images from a
    remote database at runtime into a pre-existing flash file. i have
    tried it by putting static images and converting them movie clips.
    urgent help required.
    Thanks,
    Varun TEkriwal

    you want to load an image? you want to load an mc? first step
    in successful coding is asking the right question.
    and your question was?

  • Exception in Loading Images in JSP pages

    Hi All,
    I am trying to load an image many number of times(to create a sort of graph).
    I am using Buffered Image & Graphics.drawImage().Still when my page loads I can see only the lines I draw btween the images but not the images.The images are seen only on refresh.
    I get Illegal State Exception ServletHttpResponse.getWriter().
    Can anyone help me with this at the earliest
    THANKS

    Hi,
    Here is part of my code:
    image= new BufferedImage(1000,img_height, BufferedImage.TYPE_INT_RGB);
    grph=image.getGraphics();
    Then in for loop i execute the following ,changing the co-ordinate,required no of times.
    grph.drawImage(myImage,xCord,yCord,xBlock,yBlock,null);
    Finally I do this:
    ServletOutputStream out1 = response.getOutputStream();
    JPEGImageEncoder encoder= JPEGCodec.createJPEGEncoder(out1);
    encoder.encode(image);
    The page that has this code is called by another jsp in the image tag.<img src="drawimage.jsp">
    Please Reply

  • Problem on exporting images from jsp to excel

    i had exported content of jsp to excel, but the problem is i couldn't able to export images present in jsp to excel.
    the images are present in
    webapplication / images directory.
    guys if you know any way please let me know
    code which i used for exporting was
    <%
         response.setContentType("application/vnd.ms-excel; charset=UTF-8");
         response.setHeader("content-disposition","attachment; filename=test.xls");
    %>Message was edited by:
    mohaideenkhaja

    If Somebody have the solution the please let me know......................
    Thx

  • Problem with loading image

    Hi
    I cant able to load the image my code is so simple whats the
    problem please help me........
    when me using the image tag its able to load but while using
    from the script its unable to load why??
    but i want it to be loaded in the same
    format..........(D:\images\azshear\SHAR-29-10-2006-21.0.jpg),is it
    possible??

    You need to use a double slash to escape the source attribute
    in the function. Unfortunately you cannot use the escape global
    method because it ignores the slash character.
    img.source="D:\\images\\azshear\\SHAR-29-10-2006-21.0.jpg";
    Another way to code this is to use a forward slash instead of
    a double back slash.
    img.source="D:/images/azshear/SHAR-29-10-2006-21.0.jpg";
    It works for the Image tag because the image tag will escape
    the slash character

  • Problem with loading image to Applet.

    Hello. Im preety new to Java, and currently ive got problems with adding an image to my applet. I tried to make game, similar to Mario - a platform based one. I found a source code of something close to that, and wanted to test but i couldnt get images loading. Here's the code :
    Main class :
    package pl.wat.edu;
    import java.applet.*;
    import java.awt.*;
    public class Main extends Applet implements Runnable{
         Thread th;
         private final int speed = 15;
         private Level obecny_poziom;
         private Image dbImage;
         private Graphics dbg;
         MediaTracker mt = new MediaTracker(this);
         private Image ziemia1;
         @Override
         public void destroy() {
              // TODO Auto-generated method stub
              super.destroy();
         @Override
         public void init() {
              // TODO Auto-generated method stub
              super.init();
              setSize(stale.wielkosc_apletu_szerokosc, stale.wielkosc_apletu_wysokosc);
              //setBackground(Color.blue);
              //ziemia1 = getImage(getCodeBase(), "g1.GIF");
              obecny_poziom = new Pierwszy(this, this);
         @Override
         public void start() {
              // TODO Auto-generated method stub
              super.start();
              // create new thread
              th = new Thread (this);
              // start thread
              th.start ();
         @Override
         public void stop() {
              // TODO Auto-generated method stub
              super.stop();
              // Thread stop
              th.stop();
              th = null;
         public void run() {
              // TODO Auto-generated method stub
              while (true){
                   repaint();
                   try
                        Thread.sleep(speed);
                   catch (InterruptedException ex)
                   // do nothing
         @Override
         public void paint(Graphics arg0) {
              // TODO Auto-generated method stub
              super.paint(arg0);
              //arg0.drawImage(ziemia1,10,10,this);
              obecny_poziom.paintLevel(arg0);
         public void update (Graphics g)
              if (dbImage == null)
                   dbImage = createImage (this.getSize().width, this.getSize().height);
                   dbg = dbImage.getGraphics ();
              dbg.setColor (getBackground ());
              dbg.fillRect (0, 0, this.getSize().width, this.getSize().height);
              dbg.setColor (getForeground());
              paint(dbg);
              g.drawImage (dbImage, 0, 0, this);
    }and Level class that have draw levels from String rows :
    package pl.wat.edu;
    import java.applet.Applet;
    import java.awt.*;
    public abstract class Level {
         //private LevelElement [] elements;
         private WorldTile [] tiles;
         private WorldTile[][] tablica_kolizji;
         private Color [] colors;
         private Component parent;
         private int lewa_granica;
         private int prawa_granica;
         private int dlugosclevelu;
         private Image ziemia = null;
         private Image titi;
         private Applet applet;
         public abstract void resetLevel();
         public Level(Component parent, Applet applet) {
              super();
              this.parent = parent;
              this.applet = applet;
              ziemia = applet.getImage(applet.getCodeBase(), "g1.GIF");
         public void initializeLevel(String [] definitions){
              tablica_kolizji = new WorldTile [stale.dlugosclevela] [definitions[0].length()];
              lewa_granica = 0;
              prawa_granica = stale.wielkosc_apletu_szerokosc;
              int licznik_kratek = 0;
              for(int i=0; i<definitions.length; i++){
                   char [] definition_line = definitions.toCharArray();
                   for(int j=0; j<definition_line.length; j++){
                        if (definition_line[j] == ':')
                             tablica_kolizji[i][j] = null;
                        else if (definition_line[j]== 'g'){
                             Ziemia tile = new Ziemia(j*stale.szerokoscTile, i*stale.wysokoscTile, stale.ziemia_id, ziemia, parent);
                             tablica_kolizji[i][j] = tile;
                             licznik_kratek = 0;
              tiles = new WorldTile [licznik_kratek];
              int licznik = 0;
              for (int i = 0; i<tablica_kolizji.length; i++){
                   for(int j=0; j>tablica_kolizji[i].length; j++){
                        if (tablica_kolizji[i][j] != null){
                             tiles[licznik] = tablica_kolizji[i][j];
                             licznik++;
         public void paintLevel(Graphics g)
              try
                   // draw background
                   // draw all elements in elements array
                   for(int i=0; i<tiles.length; i++)
                        tiles[i].rysujTile(g);
              catch(Exception ex)
                   // do nothing
    Any ideas why this Image doesnt show up ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    michali7x4s1 wrote:
    Thats a code i found somewhere, tried to check how some things work.Have you used exceptions before? If not, please read the sun tutorial on them as they are very very important. Also, whether this is your code or someone else's doesn't matter as it's yours now, and you would be best served by never throwing out exceptions as is done in this code. It's like driving with a blindfold on and then wondering why you struck the tree. It's always best to go through the tutorials to understand code before using it. If it were my project, I'd do it in Swing, not AWT. Fortunately Sun has a great tutorial on how to code in Swing, and I suggest you head there as well. Best of luck.

  • Problem while loading Image from datat base

    i have sotred iamge as blob in data base while reading from data base and loading i am getting error if image is more than 30 kb
    when i pass bytearrayinputstream to ImageIo.read(bytearrayinputstream ) but problem is not occure if iamge is less thatn 30 kb (approx) why is it so how to store image is data base and read from the data base
    i want both buffered image as well as SWT Image

    {color:#000080}I tried to read your post but it is throwing a NoPunctuationException.
    Would you care to repost with a few commas and full stops to make it readable?
    db{color}

  • Problem in loading images from ClassLoader

    Hi,
    I m developing a java based application. My application is GUI based. I add an image in a button. This image is placed in jar file. I'm trying to read the image with the help of the class loader, my code goes like this:
    URL aCutImageURL = this.getClass().getClassLoader().getResource("CutImage.gif");
    ImageIcon aCutImageIcon = new ImageIcon(aCutImageURL);
    JButton aBtn = new JButton(aCutImageIcon);
    But, when i try to get the image through the class loader sometimes
    it works properly but sometimes it returns null, throwing a NullPointerException.
    I've also tried to load the image using:
    URL aCutImageURL = this.getClass().getResource("CutImage.gif");
    but the problem is still there.
    Is there any other way to load the images from the jar??
    Please reply soon, its urgent!!!
    Thanks
    Smita

    Here is a sample code to get an image in a JarFile :
         public static Image getImage(String jarFileName, String fileName) {
              BufferedImage image = null;
              try {
                   JarFile jar = new JarFile(new File(jarFileName), false, JarFile.OPEN_READ);
                   JarEntry entry = jar.getJarEntry(fileName);
                   BufferedInputStream stream = new BufferedInputStream(jar.getInputStream(entry));
                   image = ImageIO.read(stream) ;
              catch (Exception ex) {
                   System.out.println(ex);
              return(image);
         }I hope this helps,
    Denis

  • Problem with loading image in html!!

    hai,
    my question is
    is it possible to show an image saved as a byte array using <img>
    is there any alternative solutions ........

    yes it's possible.
    No it's not simply a matter of parsing the binary data into your jsp at runtime.

  • 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

Maybe you are looking for

  • Cookies in iframe

    so the deal is that im trying to create a website for my mom and her friends as a replacement for MSN groups (which microsoft is shutting down soon). The idea is to create it through iweb and mobileme so its maintainable by her. the problem is the bi

  • JDBCPersistenceManagerFactory and JNDI

    Hi, I'm currently working on kodo v2.2.1. I have a problem if I use kodo with jndi. Everything is working fine if I just create a JDBCPersistenceManagerFactory with      new JDBCPersistenceManagerFactory() save it in jndi and access it later under th

  • Create  a service tax report

    Dear sap Guru, I want to create a service tax report and i am taking these table for creating this report -BKPF, RSEG,BSET, RBKP,LFA1 AND 1IMOVEND . can anybody tellme how to interlink these tables. Thanks in advance Manas

  • Connecting to a DB from an Applet

    Hi, I'm new to Java so I apologise if this question seems a bit basic. I want to display some DB contents in an applet using a web browser, but according to my Java 'bible', you cant use the JDBC-ODBC bridge driver from within an applet. How can I ov

  • IPod Gen 5, I need to reset it, but iTunes is not recognizing the device?

    I have an iPod touch that the kids disabled, but when I plug it into the cpu in recovery mode windows recognizes it but iTunes doen't?  Please help?


HashFlare