uCosminexus Application Server, Web Container Functionality Guide

[Contents][Glossary][Index][Back][Next]

3.3.1 JSF functionalities

This section describes the details on JSF functionalities.

Organization of this subsection
(1) Basic functionalities of JSF
(2) Operations of Bean Validation with Application Server
(3) JSF operations in Application Server

(1) Basic functionalities of JSF

When you develop a Web application using JSF, you can use various JSF functionalities such as defining access to the page view, page re-use, changing or validating types of input values from the client, and controlling events in the application.

You use the ManagedBean or the Expression Language functionality to implement most of the functionalities of JSF.

ManagedBean is a JavaBean that defines methods and the data to be used in the JSP and Facelets pages. For details on ManagedBean, see the JSF specifications.

The Expression Language functionality associates properties and methods defined in the ManagedBean with attributes of the JSF tags by coding properties and methods in a prescribed format. The Expression Language functionality is a part of the JSP specifications. For details, see the JSF specifications.

(2) Operations of Bean Validation with Application Server

The following table describes functionalities of the Bean Validation that can be used from JSF.

Table 3-2 Functionalities of Bean Validation that can be used from JSF

No. Functionality Overview
1 Validation of input values This functionality uses the specified validation definitions to verify the values set in ManagedBean.
 
Group management functionality This functionality groups validations.
Message management functionality This functionality manages the messages that are returned when the validation result is an error.
2 Create custom validator This functionality creates independent validation processes.

You can use the functionalities of the Bean Validation by specifying annotations. The following table describes annotation classes that can be specified for using the functionalities of the Bean Validation. The table also describes the types of variables that can be specified as well as the operations performed when an invalid type of variable is specified.

Table 3-3 Annotation classes and variable types that can be specified in the Bean Validation

No. Annotation class Variable type that can be specified Behavior when an invalid variable type is specified Remarks
1 Null You can specify any type of variable -- --
2 NotNull You can specify any type of variable -- --
3 AssertTrue
  • boolean/java.lang.Boolean
javax.validation.UnexpectedTypeException is thrown. --
4 AssertFalse
  • boolean/java.lang.Boolean
javax.validation.UnexpectedTypeException is thrown. --
5 Min
  • java.math.BigDecimal
  • java.math.BigInteger
  • byte/java.lang.Byte
  • short/java.lang.Short
  • int/java.lang.Integer
  • long/java.lang.Long
  • float/java.lang.Float
  • double/java.lang.Double
  • java.lang.String
javax.validation.UnexpectedTypeException is thrown. --
6 Max
  • java.math.BigDecimal
  • java.math.BigInteger
  • byte/java.lang.Byte
  • short/java.lang.Short
  • int/java.lang.Integer
  • long/java.lang.Long
  • float/java.lang.Float
  • double/java.lang.Double
  • java.lang.String
javax.validation.UnexpectedTypeException is thrown. --
7 DecimalMin
  • java.math.BigDecimal
  • java.math.BigInteger
  • java.lang.String
  • byte/java.lang.Byte
  • short/java.lang.Short
  • int/java.lang.Integer
  • long/java.lang.Long
  • float/java.lang.Float
  • double/java.lang.Double
javax.validation.UnexpectedTypeException is thrown. javax.validation.ValidationException is thrown if you specify a value that cannot be parsed by java.math.BigDecimal, for the value attribute.
8 DecimalMax
  • java.math.BigDecimal
  • java.math.BigInteger
  • java.lang.String
  • byte/java.lang.Byte
  • short/java.lang.Short
  • int/java.lang.Integer
  • long/java.lang.Long
  • float/java.lang.Float
  • double/java.lang.Double
javax.validation.UnexpectedTypeException is thrown. javax.validation.ValidationException is thrown if you specify a value that cannot be parsed by java.math.BigDecimal, for the value attribute.
9 Size
  • java.lang.String
  • java.util.Collection
  • java.util.Map
  • array
javax.validation.UnexpectedTypeException is thrown. javax.validation.ValidationException is thrown if you specify a negative value for the max or min attribute.
javax.validation.ValidationException is thrown if you specify a value greater than max, in min.
10 Digits
  • java.math.BigDecimal
  • java.math.BigInteger
  • java.lang.String
  • byte/java.lang.Byte
  • short/java.lang.Short
  • int/java.lang.Integer
  • long/java.lang.Long
  • float/java.lang.Float
  • double/java.lang.Double
javax.validation.UnexpectedTypeException is thrown. javax.validation.ValidationException is thrown if you specify a negative value for the integer or fraction attribute.
11 Past
  • java.util.Date
  • java.util.Calendar
javax.validation.UnexpectedTypeException is thrown. --
12 Future
  • java.util.Date
  • java.util.Calendar
javax.validation.UnexpectedTypeException is thrown. --
13 Pattern
  • java.lang.String
javax.validation.UnexpectedTypeException is thrown. javax.validation.ValidationException is thrown if the value that you have specified for the regexp attribute is incorrect as a regular expression.
Whether an expression is regular depends on the java.util.regex.Pattern specifications.

Legend:
--: Not Applicable.

(3) JSF operations in Application Server

JSF operations in Application Server are as follows: