Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2014
    Posts
    2
    Rep Power
    0

    Default Current Options for Applet to Servlet Communication

    Hello,

    I am new to Java but not new to programming and have a couple of fundamental questions about exactly *what* I should start learning based on what I want to do.

    My primary question is about which method is the best for having an applet of mine communication with a backend database of mine. In other words, I don't want to try learning a technology that is out of date or not a good fit for my goal. I purchased the O'Reilly title "Java Servlet Programming", but it seems to be very old and out of date (referencing Netscape 4, etc.) and I see a Java RMI O'Reilly title on Amazon, but it was written in 2001. I just don't know if I should focus on RMI or something else and I don't want to waste a bunch of time on the wrong thing.

    My basic goal is to allow my applet to have access to a back-end database for reading and writing. I understand that direct Applet to DB (via JDBC) access is a bad idea so my thought is to create a servlet (much like web service for lack of a better term) or an actual web service (RESTful would be my first guess) to broker the requests.

    I already have a very basic servlet running that has access to my database server so now I want to focus on the best method for making calls from the applet to the servlet but having said that I don't want to go down this road too far if a servlet is not the right tool for the job.

    My reading has been leading me to RMI, but as I said, I don't want to focus on that if there is a better option. In a non-Java environment, I'd use a web service (REST, SOAP, etc.) and perhaps that's what I should do here as well and not even bother with a servlet per se and just go with a web service.

    I know there can be some subjectivity with regard to these choices and I don't need to know what the "best" one is. Rather, I just want to make sure I don't go and try to use something that is blatantly wrong. I don't want to use RMI if it's dead or has been surpassed by something else, for example.

    Should I use a servlet? Should I use a web service? My needs are rather modest; query the database, send updates to the database, etc. Nothing too crazy.

    Any thoughts would be appreciated.

  2. #2
    kaydell2 is offline Senior Member
    Join Date
    Dec 2012
    Posts
    106
    Rep Power
    0

    Default Re: Current Options for Applet to Servlet Communication

    I would say a web service. I think that the solution is more general than using RMI.

  3. #3
    Join Date
    Feb 2014
    Posts
    2
    Rep Power
    0

    Default Re: Current Options for Applet to Servlet Communication

    Thanks for the response, I can't believe it is the only one for what would seem to be such a basic question for new Java programmers.

    I hope to find more information on other forums, this forum has been really unhelpful.

    Quote Originally Posted by kaydell2 View Post
    I would say a web service. I think that the solution is more general than using RMI.

Similar Threads

  1. Inter-Servlet Communication
    By richip in forum Java Servlet
    Replies: 4
    Last Post: 06-05-2012, 05:50 PM
  2. Replies: 0
    Last Post: 03-16-2012, 10:37 PM
  3. Servlet communication
    By narcissist in forum Java Servlet
    Replies: 4
    Last Post: 12-20-2010, 05:52 PM
  4. applet servlet communication
    By viswamadhavi in forum Java Applets
    Replies: 0
    Last Post: 04-06-2009, 01:12 PM
  5. applet servlet communication
    By hardc0d3r in forum Java Applets
    Replies: 1
    Last Post: 07-12-2007, 06:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •