To build, package, and deploy the web/hello2_basicauth example application using NetBeans IDE, follow these steps:
If you have not already done so, follow the instructions in Building the Examples. This step is necessary to provide the Ant targets with the location of your tutorial and Application Server installations.
If you have not already done so, add authorized users to the file realm of the Application Server as described in Adding Authorized Roles and Users.
Open the project in NetBeans IDE by selecting File->Open Project.
Browse to the tut-installjavaeetutorial5/examples/web/hello2_basicauth/ directory.
Make sure that Open as Main Project is selected.
Select Open Project.
Right-click hello2_basicauth in the Projects pane, then select Clean and Build.
Right-click hello2_basicauth in the Projects pane, then select Undeploy and Deploy.
To run the servlet, follow the steps in Running the Basic Authentication Servlet.