OLL Mobile


Using WebSocket for Real-Time Communication in Java Platform, Enterpise Edition 7

    • Rating:

General Information

  • This tutorial shows you how to create an application that uses the WebSocket API for real-time communication between a client and a server.

    Release Date: 26-Jun-13

    Duration: 60 minutes

    Credited To: Miguel Salazar

    No Flash Plugin Needed


  • zakized



  • nthompson


    I have been away from Java development for some time but was interested in this topic so I decided to familiarize myself with the concepts from the tutorial. The exercise was completed in about one hour and the application worked as advertised. It was very interesting to see the behaviour of the simple application from the perspective of multiple users. The tutorial was clear and concise at the beginning but soon left this novice reader puzzled. Everything went smoothly during the tutorial until the section “Declaring, Defining and Configuring the WebSocket Actions.” In steps 1 through 4 of this section, a class named StoryWebSocket was created. Then in steps 5 through 9, a number of significant manually entered code changes were made. The impression was left with this reader that the source code changes should be made to the StoryWebSocket.java file that was created in the first four steps. However, the code changes must actually be made to the Sticker.java file that was created earlier in the “Creating the Sticker Class” section. The class StoryWebSocket is never referred to again and its purpose is unclear. This tutorial would be much easier to follow if the file that is to receive the extensive code changes was explicitly named to avoid the confusion that I experienced. For example, the technique that was used in step 5 of the “Creating the Sticker Class” section, with the label “Add the following code to the Sticker.java file” is very clear and concise. A similar statement is required at steps 5 and beyond of the “Declaring, Defining and Configuring the WebSocket Actions” section.

Other Related Products

Visit the Full Site | About Oracle | Contact Us | Terms of Use