uCosminexus Application Server, System Setup and Operation Guide
The sample program using the Bean Validation and CDI integration application is stored in the following directory:
Application-Server-installation-directory\CC\examples\bv_cdi
This subsection gives an overview of the sample and describes the execution procedure.
Thi sample program provides a sample combining Bean Validation, CDI, and JSF.
With the sample Bean Validation and CDI application, the following settings must be implemented before you execute the sample:
The following figure shows the Application-Server-installation-directory\CC\examples\bv_cdi configuration.
Figure M-50 bv_cdi directory configuration
The procedure for executing the sample program is as follows:
Use the batch file (compile.bat) provided with the sample to compile the sample program. This batch file creates a WAR file (paramcheck.war) and EAR file (paramcheck.ear).
See Appendix M.1(1) Setting the J2EE server.
See Appendix M.1(2) Customizing the J2EE server.
See Appendix M.1(3) Starting the J2EE server.
See Appendix M.1(5) Importing, setting, and starting the application.
Start the browser and specify the following string in the URL to execute the application:
http://computer-name:port-number/paramcheck/
If the port number has been customized, specify the customized port-number.
The following figure shows an example execution of the sample program of Bean Validation and CDI integration application.
Figure M-51 Example execution of the sample program of CDI integration application
Click the Submit button to display the validation results in the message output location.
The following table describes the message output conditions and the output messages.
Table M-9 Message output conditions and the output messages
| No. | Condition | Output message#1 |
|---|---|---|
| 1 | When the validation is successful | Validation Successful! |
| 2 | When a string of 16 or more characters is entered in the Name textbox#2 | size must be between 0 and 15 The name must be no more than 15 characters. |
| 3 | When a value smaller than 0 is entered in the Age textbox#2 | must be greater than or equal to 0 The age is less than the minimum value. Enter a number from 0 through 120. |
| 4 | When a value greater than 120 is entered in the Age textbox#2 | must be less than or equal to 120 The age exceeds the maximum value. Enter a number from 0 through 120. |
| 5 | When a value that cannot be converted into a number is entered in the Age textbox#2 | For your age, enter a number (0 to 120). |
| 6 | When an exception occurs in the validation processing | Validation Failed. |
See Appendix M.1(6) Stopping and deleting the application.
All Rights Reserved. Copyright (C) 2012, 2013, Hitachi, Ltd.