I want to write a servlet which will actually be the client for RMI.
where shall I put the code in the servlet? for example: the following is the code for creating RMI client
RemoteInterface server = (RemoteInterface)Naming.lookup("ServerTest");
serverString = server.message("Hello there");
System.out.println("The server says:\n " + serverString);
catch (Exception e)
System.out.println("Error while performing RMI");
if I want to put this in a servlet,should I put it in the init() method or somewhere else?
are there any other changes that have to be done? Please give me a code example.