tejaspillai
Programmer
hi ,
i have some doubts on applet using rmi.
this is the rmi applet code :
-----------------
interface:
import java.rmi.*;
public interface AppletMess extends Remote
{
public String appletMessage() throws RemoteException;
}
----------------------
implementation class:
import java.rmi.*;
import java.rmi.server.*;
public class AppletMessImp extends UnicastRemoteObject implements AppletMess
{
public AppletMessImp() throws RemoteException
{
super();
}
public String appletMessage() throws RemoteException
{
return "Hello, Object One Welcome's You";
}
}
----------------------------
Server :
import java.io.*;
import java.rmi.*;
import java.rmi.server.*;
public class AppletMessServer
{
public static void main(String args[])
{
//System.setSecurityManager(new RMISecurityManager());
try
{
AppletMess sobj= new AppletMessImp();
System.out.println("main"
Naming.bind("asit", sobj);
System.out.println("Remote Object bound in registry"
}
catch(Exception ee)
{
System.out.println("Implimentation error:"+ee.getMessage());
ee.printStackTrace();
}
}
}
------------------------
Client applet : this is giving problem while running in
ie 5.0
i have also downloaded plugin from sun site.
this code works fine with appletviewer .
import java.applet.*;
import java.awt.*;
import java.rmi.*;
public class AppClient extends Applet
{
// <Applet name ="AppClient" code="AppClient" width="400" height="400"> </Applet>
String res="";
public void init()
{
System.out.println("lookup start"
//System.setSecurityManager(new RMISecurityManager());
try
{
AppletMess cobj = //(AppletMess)Naming.lookup("server"
(AppletMess)Naming.lookup("asit"
System.out.println("lookup over "
res=cobj.appletMessage();
repaint();
}
-------------------------------------------------
HTML client:
<html>
<body>
<applet code="AppClient" name="AppClient" width="400" height="400">
</applet>
</body>
</html>
-----------------------------------------
pl guide me.
how should i use java.rmi.server.codebase property?
Also
should i go for embed tag?pl let me know when to use embed tag.
waiting for your mail
Tejas
i have some doubts on applet using rmi.
this is the rmi applet code :
-----------------
interface:
import java.rmi.*;
public interface AppletMess extends Remote
{
public String appletMessage() throws RemoteException;
}
----------------------
implementation class:
import java.rmi.*;
import java.rmi.server.*;
public class AppletMessImp extends UnicastRemoteObject implements AppletMess
{
public AppletMessImp() throws RemoteException
{
super();
}
public String appletMessage() throws RemoteException
{
return "Hello, Object One Welcome's You";
}
}
----------------------------
Server :
import java.io.*;
import java.rmi.*;
import java.rmi.server.*;
public class AppletMessServer
{
public static void main(String args[])
{
//System.setSecurityManager(new RMISecurityManager());
try
{
AppletMess sobj= new AppletMessImp();
System.out.println("main"
Naming.bind("asit", sobj);
System.out.println("Remote Object bound in registry"
}
catch(Exception ee)
{
System.out.println("Implimentation error:"+ee.getMessage());
ee.printStackTrace();
}
}
}
------------------------
Client applet : this is giving problem while running in
ie 5.0
i have also downloaded plugin from sun site.
this code works fine with appletviewer .
import java.applet.*;
import java.awt.*;
import java.rmi.*;
public class AppClient extends Applet
{
// <Applet name ="AppClient" code="AppClient" width="400" height="400"> </Applet>
String res="";
public void init()
{
System.out.println("lookup start"
//System.setSecurityManager(new RMISecurityManager());
try
{
AppletMess cobj = //(AppletMess)Naming.lookup("server"
(AppletMess)Naming.lookup("asit"
System.out.println("lookup over "
res=cobj.appletMessage();
repaint();
}
-------------------------------------------------
HTML client:
<html>
<body>
<applet code="AppClient" name="AppClient" width="400" height="400">
</applet>
</body>
</html>
-----------------------------------------
pl guide me.
how should i use java.rmi.server.codebase property?
Also
should i go for embed tag?pl let me know when to use embed tag.
waiting for your mail
Tejas