How to use JavaServer Pages (JSPs) in WCM
Applies to
HCL Digital Experience 9.5 and higher
Introduction
This article describes how to use JSP components in HCL Digital Experience (DX) with the Web Content Manager (WCM).
Disclaimer
HCL Corporation created these sample steps and code to help you develop your applications. They are provided "AS IS," without warranty of any kind. HCL is not liable for any damages arising from your use of the sample code, even if HCL has been advised of the possibility of such damages.
Creating and testing a JSP component
-
Create a JSP file named
hello.jspin the following directory:<wp_profile_root>\installedApps\<cellName>\wcm.ear\ilwwcm.war\jsp\ -
In the WCM authoring tool, create a JSP component named hello.
/jsp/hello.jsp -
Edit a presentation template to use for testing.
- Select the hello JSP component.
- Select Insert Tag, and then select Component.
- Select the hello JSP component.
- Preview a content item that uses the presentation template to verify that the JSP output appears.
Rendering the JSP in a local rendering portlet
To render the JSP in a WCM local rendering portlet on a page, you must copy the JSP to the local rendering WAR file.
Copy the hello.jsp file to the following location:
<wp_profile_root>\installedApps\<cellName>\PA_WCMLRingPortJSR286.ear\ilwwcm-localrende.war\jsp
JSP component creation
You can create a JSP component as a dynamic web project using Rational Tools. However, you must create the JSP component itself within WCM to refer to it.