• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in accessing the class methods

 
Sutharshan bala
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

I'm using a applet and java class files in my application including the servlet. The database connection and the sql querys are written on a standard java class file. I'm going to host all the files in the same server. Now what i need is i need the servlet and the applet to access the java class file methods and also i need the applet to access the methods which are written in the servlet. Please let me know is it possible and also let me know how to do this.

If you know any other solutions please let me know.
Thanks in advance
 
Amol Nayak
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sutharshan wrote
also i need the applet to access the methods which are written in the servlet


Which methods of servlet do you want to access? If the method has some business logic you can move it out of servlet into a java class. Its not a great idea to create an instance of the servlet class and invove some method on it.
Please revert back and give some more details of your requirements so that we can work out on some approach.
 
Sutharshan bala
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry for the error in the post friend.

I need the servlet and the applet to access the java standard class methods in the same server, which contains the database details.

Also i want to check the user login details in applet, but i cant use session inside applet. So i need to check the session in jsp or servlet and pass that to applet via a method. Hope the problem is clearly explained now.

Give me some idea and sampLe code to handle this issue.

Thanks in advance
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Server side classes are kept under WEB-INF, a directory that is not accessible to your client side code. This means that you can't use the copy of a class file for both the client and server.

You might need to make copies of the classes that are needed by your applets and place them in a directory that is accessible to the web.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic