Book Image

Java EE 7 Development with NetBeans 8

By : David R Heffelfinger
5 (1)
Book Image

Java EE 7 Development with NetBeans 8

5 (1)
By: David R Heffelfinger

Overview of this book

Table of Contents (18 chapters)
Java EE 7 Development with NetBeans 8
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Building our own WebSocket applications


In the previous section, we saw how NetBeans provides sample WebSocket applications we can use as a base for our own projects. In this section, we will build a web application that contains a WebSocket server endpoint that will populate a form with default values.

To build a WebSocket application, create a web application project by going to File | New Project, selecting the Java Web option from the Categories list, and selecting Web Application from the Projects list.

Then, we pick a name and location as usual.

The Java API for WebSocket was introduced in Java EE 7; therefore, we must select this Java EE version if we want to develop WebSocket applications. The default values in this step of the wizard are sensible and can be used as they are:

In our example, we will be using JSF for the user interface. Therefore, we need to select JavaServer Faces from the Frameworks list.

Now, we are ready to develop our WebSocket application.

Developing the user interface...