background image

Building the Form-Based Authentication Example

<< Mapping Application Roles | Testing the Form-Based Authentication Example >>
<< Mapping Application Roles | Testing the Form-Based Authentication Example >>

Building the Form-Based Authentication Example

Building, Packaging, and Deploying the Form-Based Authentication
Example Using NetBeans IDE
To build, package, and deploy this application using NetBeans IDE, follow these steps:
1. Follow the instructions in
"Building the Examples" on page 70
if you have not already done
so. This step is necessary to provide the Ant targets with the location of your tutorial and
Application Server installations.
2. Add users to the file realm of the Application Server as described in
"Adding Authorized
Roles and Users" on page 872
if you have not already done so.
3. Open the project in NetBeans IDE by selecting File
Open Project.
4. Browse to the tut-install/javaeetutorial5/examples/web/hello1_formauth/ directory.
5. Make sure that Open as Main Project is selected.
6. Select Open Project Folder.
7. If you are prompted to regenerate the build-impl.xml file, select the Regenerate button.
8. Right-click hello1_formauth in the Projects pane, then select Clean and Build Project.
9. Right-click hello1_formauth in the Projects pane, then select Deploy Project.
10. Follow the steps in
"Testing the Form-Based Authentication Web Client" on page 875
.
Building, Packaging, and Deploying the Form-Based Authentication
Example Using Ant
To build, package, and deploy this application using the Ant tool, follow these steps:
1. Follow the instructions in
"Building the Examples" on page 70
if you have not already done
so. This step is necessary to provide the Ant targets with the location of your tutorial and
Application Server installations.
2. Add users to the file realm of the Application Server as described in
"Adding Authorized
Roles and Users" on page 872
if you have not already done so.
3. From a terminal window or command prompt, change to the
tut-install/javaeetutorial5/examples/web/hello1_formauth/ directory.
4. Enter the following command at the terminal window or command prompt:
ant
This target will spawn any necessary compilations, copy files to the
tut-install/javaeetutorial5/examples/web/hello1_formauth/build/ directory, create
the WAR file, and copy it to the
tut-installjavaeetutorial5/examples/web/hello1_formauth/dist/ directory.
5. Deploy the WAR named hello1_formauth.war onto the Application Server using Ant by
entering the following command at the terminal window or command prompt:
Examples: Securing Web Applications
The Java EE 5 Tutorial · September 2007
874