unable to access gif files from the server

hi all,

i have successfully signed an applet and it is loading in the client system also. in that applet, i instantiated a jbutton as given below:

JButton jb = new JButton(new ImageIcon("http://192.168.91.154:8080/success/set.gif"));

but the icon din appear and a blank button appears, even when accessed from the server system.

if i give the exact path like c:/blazix/webfiles/success/ set.gif, the icon is coming in the server system but not in other systems. i tried without port no also but in vain. pl solve my problem. what i need is how to

specify the path of the file[any file] which is present in server.

or if i put all the gif files in the jar file, can i access the gif files present in the jar file [set for archive] ? if i can, give me the soln for accessing the gif file present in the jar file, so that i need not access the server to get the gif files.(i.e) how to specify the path of the gif files present in the jar file?

i ve one more doubt. the jni library file shld be in the server, and the client has to access the library in the server. i think the applet loaded in the client ll search for the library in the local m/c only . how to make the applet to search for library in the server?

i feel only by using rmi we can solve this problem. am i correct? if so i feel that an appln or applet running in the server shld access the jni library, and the applet in the client side should communicate with this server appln using rmi to get the data.is it correct? is there

anyother way?

i appreciate your help in this regard. thanks in advance. bye, padmanbhan.

[1666 byte] By [padmanabhank_iyengar] at [2007-9-26 4:44:14]
# 1

hi all, im able to access the gif file from jar by using

getClass().getResource( "image.gif" ).can anyone solve my jni problem? i ll give 3 duke dollars to the best solution.

the jni library file shld be in the server, and the client has to access the library in the server. i think the applet loaded in the client ll search for the library in the local m/c only . how to make the applet to search for library in the server?

i feel only by using rmi we can solve this problem. am i correct? if so i feel that an appln or applet running in the server shld access the jni library, and the applet in the client side should communicate with this server appln using rmi to get the data.is it correct?

can i use jni wrapper class in the server so that the applet loaded in the client wld use the jni wrapper class present in the server? how to achieve this?

is there anyother way?

i appreciate your help in this regard. thanks in advance. bye, padmanbhan.

padmanabhank_iyengar at 2007-6-29 18:32:13 > top of Java-index,Security,Signed Applets...
# 2
You can't do thatJButton jb = new JButton(new ImageIcon(" http://192.168.91.154:8080/success/set.gif"));You must creat a new URL objetc :URL url = new URL(" http://192.168.91.154:8080/success/set.gif");Hope it helpChris
christophe.arioli at 2007-6-29 18:32:13 > top of Java-index,Security,Signed Applets...
# 3

Better information on what you are doing with JNI might help you get an answer.

If you have some server process that needs to use JNI, then I would code a servlet to call, instead of using RMI to ge there.

Depending on your environment, and the target audiences environment, RMI may just cause you a lot of grief. Firewalls etc, get in the way of RMI connections and force security holes to be opened in order to work.

If you use a servlet, then traffic to your server process is done via standard http calls, which will already be enabled, because your app runs in a browser.

If ther data requirements are heavy duty, your server could always send an XML stream to the client, which would allow you to describe complex data to the client.

Running JNI stuff from the client directly means a lot of local infrastructure to run your app. The code you want to run, the JNI library ....

If what you have is really an application, but want the convenience of starting it from a browser, look at Java WebStart. Then you can distribute an application via the browser, and WebStart will worry about the deployment issues for you.

In Summary:

Stay away from RMI from applets if you can help it.

If you really have an App, then try WebStart to manage the distribution issues for you.

jan.svensson at 2007-6-29 18:32:13 > top of Java-index,Security,Signed Applets...