Configuring and Running the Application
The IDE uses an Ant build script to build and run your web application. The IDE generated the build script when you created the project, basing it on the options you entered in the New Project wizard. Before you build and run the application, you need to set the application's default entry point to login.jsp. Optionally, you can also add a simple stylesheet to the project.
Setting the Welcome Page.
Attaching a Stylesheet.
Running the Application.
Setting the Welcome Page
1. In the Projects window, double-click the web.xml deployment descriptor. The tabs listed along the top of the Source Editor provide you with an interface to the web.xml file. Click on the Pages tab. In the Welcome Files field, enter login.jsp.
Now click on the XML tab to view the file. Note that login.jsp is now listed in the welcome-file entry:
Attaching a Stylesheet
1. Add a simple stylesheet to the project. One easy way to do this is by saving the sample stylesheet available in the same folder as this project (for example, the web folder). The file should be visible in the NetBeans project explorer.
Or, copy the file (Ctrl-C), then in the IDE, select the Web Pages node in the Projects window and press Ctrl-V). The file is added to your project.
2. Link the stylesheet to your JSP pages by adding a reference between the <head> tags of both login.jsp and success.jsp:
<link rel="stylesheet" type="text/css" href="stylesheet.css">
Running the Application
1. In the Projects window, right-click the project node and choose Run. The IDE builds the web application and deploys it, using the server you specified when creating the project. The browser opens and displays the login.jsp page.
Try entering data that should pass validation. Upon clicking Login, you are presented with the success page:
2. Type in some data that should fail validation, i.e., either leave either field blank, or enter an email address with a missing '@' sign. When you click Login, the login form page redisplays, containing an error message:
If there are any errors, they should be visible in the output windows.