5 Using JSF and JSTL
This chapter includes the following sections:
Using JSF and JSTL With Web Applications
JSF and JSTL are an integral part of Jakarta EE and, as such, are incorporated directly into WebLogic Server. All Jakarta EE technologies are present on the WebLogic Server classpath. No additional configuration is required to use any of the Jakarta EE technologies in your applications. Applications deployed to WebLogic Server can seamlessly make use of JSF 2.3 and JSTL 1.2 without requiring you to deploy and reference separate shared libraries.
The Jakarta EE API JAR file is included in WL_HOME\wlserver\server\lib\javax.javaee-api.jar
, where WL_HOME
represents the top-level installation directory for WebLogic Server.
For information about referencing these shared libraries with your Web applications, see Creating Shared Jakarta EE Libraries and Optional Packages in Developing Applications for Oracle WebLogic Server.
Jakarta Server Faces (JSF)
JSF technology simplifies building user interfaces for JavaServer applications. Developers of various skill levels can quickly build Web applications by: assembling reusable UI components in a page, connecting these components to an application data source, and wiring client-generated events to server-side event handlers.
https://jakarta.ee/specifications/faces/2.3/
. WebLogic Server support includes:
- Better CDI integration; a CDI-compatible
@ManagedProperty
annotation. - Better WebSocket integration; direct support for WebSockets using the new
<f:websocket>
tag. - Ajax method invocation.
- Class-level bean validation using the new
<f:validateWholeBean>
tag. - Java date and time support.
- Enhanced component search expression framework.
These features are described in detail in the Java EE Tutorial at https://javaee.github.io/tutorial/toc.html
and in https://github.com/jakartaee/faces
.
If you selected to install the server examples with your WebLogic Server installation, the sample application demonstrates the following key features of JSF 2.3:
- Ajax method invocation using the new
<h:commandScript>
component - CDI converter
- Iterable
h:dataTable
- CDI for evaluation of JSF-specific EL implicit Objects
- CDI injection
- New Java date and time
@ManagedProperty
- Iterable
ui:repeat
- Class-level bean validation using
f:validateWholeBean
- CDI validator
- WebSocket using
f:websocket
The JSF 2.3 examples are located in the ORACLE_HOME\wlserver\samples\server\examples\src\examples\javaee8\jsf
directory, where ORACLE_HOME
represents the directory in which you installed WebLogic Server.
For more information about the WebLogic Server code examples, see Sample Applications and Code Examples in Understanding Oracle WebLogic Server.
Parent topic: Using JSF and JSTL With Web Applications
Jakarta Standard Tag Library (JSTL)
The Jakarta Standard Tag Library (JSTL) encapsulates as simple tags the core functionality common to many Web applications. JSTL has support for common, structural tasks, such as:
-
Iteration and conditionals
-
Tags for manipulating XML documents
-
Internationalization tags
-
SQL tags
JSTL also provides a framework for integrating existing custom tags with JSTL tags.
WebLogic Server supports the JSTL 1.2 specification at https://jakarta.ee/specifications/tags/1.2/
.
Parent topic: Using JSF and JSTL With Web Applications
JSF Backward Compatibility
Applications built for JSF 1.2 should run unmodified on WebLogic Server 14.1.2.0.0, assuming you remove any bundled JSF implementation from the application configuration. If you follow this process and applications do not run, WebLogic Server provides JSF and JSTL libraries that can be deployed and referenced by applications.
Note:
The jsf-2.0.war
deployable library, included in WebLogic Server, is empty, as applications built for JSF 2.0 will continue to run unmodified using the built-in JSF 2.3 implementation of WebLogic Server 14.1.2.0.0.
WebLogic Server includes the empty jsf-2.0.war
library to avoid any software that depends on its existence. You can leave references to the library unchanged without harm. However, Oracle recommends removing any references to this empty library, as these references add no functionality.
See the following sections:
Deploying JSF and JSTL Libraries
Note:
In this release of WebLogic Server, you can deploy JSF 2.3 and JSTL 1.2 applications directly. For backward compatibility, use the following directions when deploying JSF 1.x and JSTL 1.1 applications.
When deploying JSF 1.2 applications, use the JSF and JSTL libraries which are provided as Web application libraries. You must deploy the libraries before deploying the Web application that is using JSF 1.2 or JSTL functionality. You can deploy the libraries using the WebLogic Remote Console or the command-line weblogic.Deployer
utility.
Here's an example of deploying a JSF 1.2 library using the weblogic.Deployer
command-line:
java weblogic.Deployer -adminurl t3://localhost:7001 -user weblogic -password weblogic -deploy -library d:/oracle_home/wlserver/common/deployable-libraries/jsf-1.2.war
This command deploys the JSF 1.2 library using the default library-name
, specification-version
and implementation-version
defined by the MANIFEST.MF
in the library.
After a library is deployed, the extension-name
, specification-version
and implementation-version
of the library can be found in the Remote Console. This information can also be found in the MANIFEST.MF
file of the library WAR
file.
For more information about deploying a Web module, see Preparing Applications and Modules for Deployment in Deploying Applications to Oracle WebLogic Server.
Parent topic: JSF Backward Compatibility
Referencing a JSF or JSTL Library
To reference a JSF or JSTL library, a standard Web application can define a <library-ref>
descriptor in the application's weblogic.xml
file. Here is an example:
<library-ref> <library-name>jsf</library-name> <specification-version>1.2</specification-version> <implementation-version>1.2</implementation-version> <exact-match>false</exact-match> </library-ref>
For more information on referencing a Web application library, see Creating Shared Jakarta EE Libraries and Optional Packages in Developing Applications for Oracle WebLogic Server.
Parent topic: JSF Backward Compatibility