Creating a servlet

The Raspberry Pi can be controlled through a simple web page that can be generated by a simple servlet. The following steps will guide you through creating and configuring a servlet with NetBeans:

  1. Right-click on the iot Maven Webapp in the Projects explorer and from the context menu click New| Servlet. In the New Servlet dialog box (Figure 6-11), type gpio as the File Name.
  2. Click the Next button to proceed:
Figure 6-11: New servlet - Name and Location
  1. In the final step (Figure 6-12), select Add information to deployment descriptor (web.xml). Don't change the default Servlet Name (gpio) and URL Pattern (/gpio). Click the ...

Get Raspberry Pi 3 Projects for Java Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.