AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Strange behavior of Applet.getImage(URL)

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Security and Java
View previous topic :: View next topic  
Author Message
Chris Berg
Guest





PostPosted: Sat Oct 29, 2005 9:41 am    Post subject: Strange behavior of Applet.getImage(URL) Reply with quote



In my SIGNED applet, I try to show an image:

String pImage = "/images/myimage.gif";
Image image = getImage(getDocumentBase(), pImage);

The document base is

https://doc_domain/path/ (notice the 's' in https)

The codebase is a different domain:

http://code_domain/path/ (no 's')

When the applet runs, something quite unexpected happens: the
applet first tries to fetch the image from the server at
code_domain!!!. In its web log, i can see that it has tried to fetch

http://code_domain/images/myimage.gif

then, a second later, it fetches the intended image at

http://doc_domain/images/myimage.gif

It has no effect to actually put an image file on the codebase server.
The image eventually diplayed is the right one - the one from the
doc_domain server.

I've tried it on different Java versions, and it appears to not do it
on versions 1.3 or lower, though I'm not quite sure about it.

Also, I've tried

URL url = new URL(getDocumentBase(), "/images/myimage.gif");
Image image = getImage(url);

- same result.

Chris


Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Security and Java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.