Follow the steps in To Set Up Your System for Running the Security Examples.
In a terminal window, go to:
tut-install/examples/security/cart-secure/ |
To build the application and package it into an EAR file, type the following command at the terminal window or command prompt:
ant |
To deploy the application to the GlassFish Server, type the following command:
ant deploy |
To run the application client, type the following command:
ant run |
This task retrieves the application client JAR and runs the application client.
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 are authenticated, the client displays the following output:
[echo] running application client container. [exec] Retrieving book title from cart: Infinite Jest [exec] Retrieving book title from cart: Bel Canto [exec] Retrieving book title from cart: Kafka on the Shore [exec] Removing "Gravity's Rainbow" from cart. [exec] Caught a BookException: "Gravity's Rainbow" not in cart. [exec] Result: 1 |
If the username and password are not authenticated, the dialog box reappears until you type correct values.