Bookmark Topic Watch Topic
  • New Topic

jsp vs rmi

 
Rajasekhar Pentakota
Ranch Hand
Posts: 38
Java MyEclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
I would like to call the remote methods (rmi) from jsp.

How can I do so.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
JSPs are meant for generating text output, not for executing lengthy code. Have you considered using a backing bean or a servlet instead?
 
Rajasekhar Pentakota
Ranch Hand
Posts: 38
Java MyEclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
When I try with java Bean then Access Denied error is shown in the tomcat console.

the class I used is
==================================

package client1;

import java.rmi.*;
import java.io.*;
import server1.RajaServiceServer;
import interface1.RajaService;

public class RajaJspServiceClient
{

public int getsq(int sq) throws Exception
{
if (System.getSecurityManager() == null)
{
System.setSecurityManager
(new RMISecurityManager());
}

// Call registry for PowerService
RajaService service = (RajaService) Naming.lookup
("rmi://localhost/RajaService");

return service.square(sq);

}

}
 
Rajasekhar Pentakota
Ranch Hand
Posts: 38
Java MyEclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Continuation of this thread is in another new thread
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
"RajaSekhar", please check your private messages for an important administrative matter.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!