Follow the steps in To Set Up Your System for Running the Security Examples.
In NetBeans IDE, select File->Open Project.
In the Open Project dialog, navigate to:
tut-install/examples/security/ |
Select the cart-secure folder.
Select the Open as Main Project and Open Required Projects check boxes.
Click Open Project.
In the Projects tab, right-click the cart-secure project and select Build.
In the Projects tab, right-click the cart-secure project and select Deploy.
This step builds and packages the application into cart-secure.ear, located in the directory tut-install/examples/security/cart-secure/dist/, and deploys this EAR file to your GlassFish Server instance.
To run the application client, right-click the cart-secure project and select Run.
A Login for user: dialog box appears.
In the dialog box, type the user name and password of a file realm user created on the GlassFish Server and assigned to the group TutorialUser; then click OK.
If the user name and password you enter are authenticated, the output of the application client appears in the Output pane:
... Retrieving book title from cart: Infinite Jest Retrieving book title from cart: Bel Canto Retrieving book title from cart: Kafka on the Shore Removing "Gravity's Rainbow" from cart. Caught a BookException: "Gravity's Rainbow" not in cart. Java Result: 1 ... |
If the user name and password are not authenticated, the dialog box reappears until you type correct values.