Writing your first Java web application
The servlet you will be writing to control the Raspberry Pi's GPIO pin through the internet or any local area network requires a series of configurations to build and test in the Windows environment. Then you will deploy the project to the Raspberry Pi manually and run it on the Jetty server.
Creating a Maven project from Archetype
- Open the NetBeans IDE and from the menu bar, click on
File
|New Projec
t
. TheNew Project
wizard will appear. - In
Choose Project
(step 1), selectMaven
underCategories
andProject from Archetype
underProjects
,as shown in Figure 6-4. - Then, click the
Next
button to proceed:

Figure 6-4: Choose project
- In
Maven Archetype
(step 2), selectmaven-archetype-webapp
underKnown Archetypes
, as shown in Figure 6-5.
- Then, click the
Next
button to proceed:

Figure 6-5: Maven Archetype
- In
Name and Location
(step 3), typeiot
forProject Name
,com.packt.B05688
forGroup Id
, andcom.packt.B05688.chapter6
forPackage
, as shown in Figure 6-6.
- Then...