First of all, download a version of the webapp from
Download.
Download the project for Netbeans if you want to modify the sources.
Even if you use a different IDE, like Eclipse, downloading the Netbeans
project would be better than downloading only the sources because
you will get all the necessary files and libraries to build the webapp
and generate a war file.
In the next pages, we will see in detail how to configure: