This section discusses JavaServer Pages (JSPs) and JSP tags.
JavaServer Pages (JSPs) are used to dynamically construct HTML pages requested by a client Web browser. Any HTML page can contain URL links that cause a JSP to be rendered and returned to the HTML browser. JSP tags render HTML contents based on the attributes of the tag and dynamic information obtained from the context.
UNICOM® Digital Transformation Toolkit (UDTT™) provides custom JSP tags and utility beans to enable applications to retrieve information from the operation context hierarchy, get resources, and handle errors. If your application requires additional behavior, you can build new tags using the JspContextServices interface.
The toolkit provides components that aid in the development of an HTML user interface in the following two areas:
▪ Application runtime architecture (assisting in HTML page composition using an HTML editor)
▪ Generation of the required user interface components (assisting in massive generation of pages that follow the same patterns)
For the runtime architecture, JSP tags are provided to render the HTML page contents based on runtime variables. The JspContextServices bean that is internally used by the implementation tags provides the following functionality:
▪ Provides access to the current operation's context information
▪ Controls the system information, such as paths to the resources and session information, that is needed to respond to a client request
The JSP tags provided in the toolkit help in the development of applications that require an HTML graphical user interface. The JSP tags provide the following features:
▪ Encapsulated Java code that knows how to render HTML tags based on dynamic attributes
▪ Java code to integrate dynamic information obtained from the runtime context, using the JspContextServices interface (for example, information for a data field, field validation errors, and hidden fields to be sent to the client)
▪ Exception and error management using the JspContextServices interface
▪ Compound components, such as the combination of an entry field with its related label. This feature allows the system to set the label color based on the status of the data associated with the entry field.
The JSP tags depend on the following toolkit components:
▪ The HTML Connector and its corresponding HtmlRequestHandler and HtmlPresentationHandler. The presentation handler uses the JSP engine to process the JSP contents. These classes are dependent on the JspContextServices interface and the DSEJspContextServices implementation class, which provides access to the information in the context.
▪ Typed data elements, which are used by the DSEJspContextServices class to exploit the information for a specific data element.
The package, including the JSP tags components, is named com.ibm.btt.gui.jsptags. See Custom JSP tags for a complete list of the provided tags.
Data elements in the toolkit can be typed, which means that they know the type of business object they represent. Examples of business objects are Money, Date, ProductNumber, and CorrespondenceAddress. Data Elements that are type-aware know the business rules they should exhibit. For example, they know how to format themselves for display and perform any required validation when they are requested to change their value. They also know how to clone themselves, and they contain some status information flags that are updated by the application during its life cycle.
This functional information provided by the operation runtime model (the context hierarchy) is used by the JSP tags to render a business field as an HTML visual control. The JSP tags may exploit the model information, which may indicate whether a field is mandatory, if it is a read-only field, if it is in error, and what validation script is associated with the field. Most tags only use a subset of these properties. If a property is requested by the tag and this property is not defined, then the tag assumes the following default values: