Web Content Management JSP tags

 

+

Search Tips   |   Advanced Search

 

Use IWWCM JSP tags with the Web Content Management API to pull Web Content Management content and components into external JSP applications.

A JSP referenced within a JSP component must not include a reference, directly or indirectly, to the same JSP component. This includes references within Web Content Management tags or the API. If it does, a loop is created and the server will crash.

To use the Web Content Management JSP tags, the following directive must be provided in the JSP:

   <%@ taglib uri="/WEB-INF/tld/wcm.tld" prefix="wcm" %>

 

Storing JSP pages

The JSP page must be stored within...

..\AppServer\profiles\wp_profile\installedApps\node-name/wcm.ear/ilwwcm.war

...of the Web Content Management Server. The JSP page may also need to be stored in the client war directory of the servlet or portlet that calls the JSP if using the Web Content Management API.

 

Writing JSP to be referenced within a JSP component

The setExplicitContext and setContext tags specified below are not required when displaying a JSP file via a JSP Component. They are only required when directly accessing a JSP file.

 

InitWorkspace tag

This is used to set the initial workspace.

<wcm:initworkspace username=" " password=" " >
[Error Message]
</wcm:initworkspace>

username=" " The username of a valid Web Content Management user.
password=" " The password for the valid Web Content Management user.

 

Explicit context tag

This sets the path to the Web Content Management server. This is not required in JSP that is displayed via a JSP component.

<wcm:setExplicitContext wcmWebAppPath=" " wcmServletPath=" " path=" " >
[Error Message]
</wcm:setExplicitContext>

wcmWebAppPath=" " The URL up to the web application. I.e. - up to and including the context path.

For example, http://localhost:10038/wps/wcm

wcmServletPath=" " The servlet path to the Web Content Management servlet

For example, /connect

path=" " The path to the content including the site and siteareas.

For example, SiteA/Site Area A/ Site Area B/Content C

The wcmWebAppPath and wcmServletPath parameters are optional. However, if wcmWebAppPath is specified, wcmServletPath must also be specified.

Developers can add insert context tags at any place in the page and it will change the context for the rest of the page execution, but the tags cannot be nested.

 

Context retrieval tag

Sets context given the location of a path string. That is where to look for it and the name of the parameter it will be in. This is not required in JSP that is displayed via a JSP component.

<wcm:setContext location=" "  wcmWebAppPath="" wcmServletPath="" param=" " >
[Error Message]
</wcm:setContext>

location=" " This sets the context of the location of a path string. Either:

  • query

  • request

  • session

wcmWebAppPath=" " The URL up to the web application. I.e. - up to and including the context path.

For example, http://localhost:10038/wps/wcm

wcmServletPath=" " The servlet path to the Web Content Management servlet

For example, /connect

param=" " This is the name of the parameter that the path string will be in.

The wcmWebAppPath and wcmServletPath parameters are optional. However, if wcmWebAppPath is specified, wcmServletPath must also be specified.

Developers can add insert context tags at any place in the page and it will change the context for the rest of the page execution, but the tags cannot be nested.

 

Rendering tags

There are two rendering tags. These are equivalent to element and component tags.

Rendering a component from the current site, site area, or content item.

<wcm:contentComponent type=" " key=" " >
[Error Message]
</wcm:contentComponent>

type=" " This determines where the component is being referenced from. Either "content", "sitearea" or "site".
key=" " This is the name of this component being referenced.

Rendering a component from the Component Library

<wcm:libraryComponent name=" " >
[Error Message]
</wcm:libraryComponent >

name=" " This is the name of this library component being referenced.

Rendering Content based on the current context of a page

<wcm:content pageDesign=" " >
[Error Message]
</wcm:content >

pageDesign=" " This name of the Presentation Template used to determine context. This parameter is optional.

 

Error handling

The following tag can be added to error messages to enable error handling:

<%=error%>

 

Parent Topic

The IWWCM API