Show TOC Start of Content Area

Procedure documentation Using the SAP Component Library for JSF  Locate the document in its SAP Library structure


The SAP Component Library for JSF provides seamless integration with the look and feel of SAP Web frameworks like Web Dynpro or Business Integration. It is suitable for both developing applications from scratch, and for migrating existing applications developed with usage of JSF 1.2 standard components to the SAP look and feel.


The Web application is available as a Dynamic Web Project in SAP NetWeaver Developer Studio.

More information: Creating Dynamic Web Projects.


1. Add a runtime dependency to the SAP Component Library in the application-j2ee-engine.xml

This is done by adding the following source code to the META-INF/application-j2ee-engine.xml:


            <application-j2ee-engine xmlns:xsi=""


                 <reference reference-type="weak">

                        <reference-target target-type="library" provider-name="">





By adding this dependency, the Web application can access classes of the SAP Component Library for JSF at runtime.

More information:

      Editing the application-j2ee-engine.xml

      Editing Runtime References in the application-j2ee-engine.xml


2. Declare the SAP Component Library in the JSP Source Code

This is done by adding the following line to the JSP source code:

<%@ taglib uri="" prefix="h" %>

If you are migrating an existing JSP page that uses JSF 1.2 standard components, you need to replace the original taglib URI with the latter.


This is a simple JSP file that uses the SAP Component Library:

          <%@ page contentType="text/html; charset=UTF-8" %>

          <%@ taglib uri="" prefix="h" %>

          <%@ taglib uri="" prefix="f" %>





                  <title>Hello World</title>


                  <h:outputText value=”Hello World!”/> 





The tag library descriptor contains all UI components from the tag library of the Java standard. There are some limitations in the tag library caused by the focus of that library, for example, concerning style and Java Script. The runtime execution for these attributes can be deactivated with the following entry in your web.xml:

         <web-app version="2.5" xmlns=""


         xsi:schemaLocation="    ">






In this case, unsupported attributes and tags are listed at runtime so that existing applications can be easily migrated to the SAP Component Library for JSF.

3. Additional Steps

The following additional steps are necessary to migrate the JSP pages to the SAP Component Library for JSF:

      Remove the DOCTYPE element in your HTML files and store your files in the UTF-8 format.

      Move the <f:view> root tag to beginning of the document. It has to be the root element so that the complete content is rendered by the JSF lifecycle.

      Remove style attributes, stylesheet links and JavaScript from your document.


It may be helpful to activate the full stack trace for error pages. This is done by entering the following Telnet command to AS Java:

setsp –p DetailedErrorResponse true http

More information: SAP Note 1113811


End of Content Area