Solved

"Image" in JSP and WebSphere

Posted on 2002-06-16
13
310 Views
Last Modified: 2010-04-01
Hi guys, i have some problems here.

I have create a web-pages using JSP 1.0 and WebSphere Application Server 3.5.4. In my web-pages I would like to put some image in the JSP pages. But the picture doesn't show up. I have checked thousand time on the coding and it's absolutely right. But end of the things, it's doesn't show the picture.

But... if I change my WebSphere to Apache Tomcat, the pages work fine!

What's wrong in here?? Ha...


********************************************************
<html>
<head>
<title>Machnie Information (JNPF30r)</title>
<body bgcolor= 9999FF onLoad="scrollit(100)">
<TABLE border="0">
<tr>
     <td>
     <img src="logo.jpg" alt="Logo">
     <img src="msia.jpg" alt="Malaysia">
     </td>
</tr>
</table>
<br>
<h2>Please Select Division Code or Machine Model ver. 2</h2>
     Serial Number  :  <Input type="text" name="serial" size="10" />
     </h2>
<br>
</body>
</html>
******************************************************

I am very sure also that the logo.jpg and msia.jsp is in the directory.

TQ..
0
Comment
Question by:foongkim
13 Comments
 
LVL 92

Accepted Solution

by:
objects earned 50 total points
ID: 7082881
As a test try viewing the image files directly.
For example if you jsp url is:
http://my.com/xyz/a.jsp
Then try to loadyour images using:
http://my.com/xyz/logo.jpg
http://my.com/xyz/msia.jsp

This will confirm whether they are available or not.
Let me know how you go.

0
 
LVL 1

Expert Comment

by:raid999
ID: 7083152
you are using a reletive address for the Pics try using Absolute like http://url/logo.jpg
0
 

Author Comment

by:foongkim
ID: 7083162
object and raid999,

Thanks for your concern. TQ.

I have tried like what u told, but the IE return, "The Page Can Not be found".

The JSP pages is called, checkimg.jsp, and the way I call this pages is by http://cmmsb:1025/checkimg.jsp. So, like what u all said, when I type, http://cmmsb:1025/logo.jsp or http://cmmsb:1025:msia.jsp, both return Page Can Not Found.

I am sure the .jpg files is there. Same directory like my checkimg.jsp.

????
0
 
LVL 92

Expert Comment

by:objects
ID: 7083173
Check if there are two versions of checkimg.jsp.
And that the jpg files exist in the same directory as all versions of checkimg.jsp.

0
 

Author Comment

by:foongkim
ID: 7083180
In Apache, I have tested the programs. And samething happend to Websphere. Nothing wrong with this..... I mean the version of the checkimg,jsp and the jpg files. Only and only one object only in that directory.

:(

Very strange case right?

I suspect is the WebSphere causing me problems. Cause I run my JSP and jpg in AS400 files system. And my .jpg and .jps is uploaded through the FTP concepts. But for sure the .jsp is working because all the while I am using FTP method to post my jsp programs into my AS400.

0
 
LVL 92

Expert Comment

by:objects
ID: 7083205
> when I type, http://cmmsb:1025/logo.jsp 

Is this a type, should be logo.jpg.

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:foongkim
ID: 7083219
Sorry, i type http://cmmsb:1025/logo.jpg and http://cmmsb:1025/msia.jpg in the IE address bar
0
 
LVL 92

Expert Comment

by:objects
ID: 7083223
Then i'd be triple checking that the jpeg files exist in the same directory as your jsp, cause the web server does not appear to be finding them there.
0
 

Author Comment

by:foongkim
ID: 7083230
Yeah.... ojects.. so great u understand what is my problems is.....
So starnge is it....

Ha....

Come, see we can solve the problems together or not. I have just reported to IBM and wait for their respond...
0
 
LVL 3

Expert Comment

by:mjzalewski
ID: 7093563
Check the case of your URL.

It must match exactly the case of the image stored in the web root. Even though in NT, the files named "image.jpg" and "Image.jpg" are the same thing, they are not the same thing in UNIX. If you want to make your application truly portable, you must treat the file names as though case mattered. Also, if you were to put your images into a WAR file, case would matter.

I know that WebSphere enforces this, as of something like 3.5.2. I also know that other application servers such as JRun do not enforce this.

0
 

Author Comment

by:foongkim
ID: 7094334
HI all, I have checked with the documentation regarding my WebSphere.

I think I need to some configuration on my HTTP Server which act as Web Server for my WebSPhere APplication Server. It's because when I type in the url for my picture files, it doesn't show up.
0
 

Author Comment

by:foongkim
ID: 7100223
Actually I solve the problem myself.

The magic part is the HTTP Server which act as WebServer with Websphere Application. I need to specify the exact location of the html pr jpg files location in the HTTP Server.

While for my jsp pages, all the while the server instances I created is JSP and servlet enabled. That's why my jsp pages can view and jpg or html can not view.

:)
0
 
LVL 92

Expert Comment

by:objects
ID: 7101148
Good to hear you gor it solved.
Thanks for the points :)

http://www.objects.com.au/staff/mick
Brainbench MVP for Java 1
http://www.brainbench.com
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How To Remove a Principal from HttpServletRequest 4 40
rebasing and merging used in SCM 1 66
reflection example 3 92
java cigar challenge 58 206
What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now