Documentation Center

Installing the Image Transformation servlet in a Java Web application

To make the Image Transformation servlet work in Java, add Contextual Image Delivery resources to your API (in-process) Server Role. Because this is a deprecated and discouraged setup, you can only get the resources from SDL Customer Support.

Procedure

  1. Contact SDL Customer Support to obtain the WAR file for the Image Transformation servlet, called context-image-war.war
  2. Navigate to the WEB-INF\lib\ subdirectory of your target folder.
  3. Copy all files in this folder into the WEB-INF\lib\ folder of your API (in-process) Web application.
  4. If you want to run the image transformer against a customized URL, access the WEB-INF/classes/ folder of your Web application.
  5. Open cd_ambient_conf.xml for editing.
  6. In the <ExcludedPaths> section, add a subelement <Path>/CUSTOM/PATH</Path>, where /CUSTOM/PATH refers to the customized URL that you want the image transformer to run against.
  7. Save and close cd_ambient_conf.xml.
  8. In the root folder of your Web application, open web.xml for editing.
  9. Create a new servlet section with the following contents (you can also copy-paste this section from the file web.xml located in the installation media folder configuration/samples/):
    <servlet>
      <servlet-name>imageTransformer</servlet-name>
      <servlet-class>com.sdl.context.image.servlet.ImageTransformerServlet</servlet-class>
    </servlet>
  10. Create a new servlet-mapping section with the following contents (you can also copy-paste this section from the file web.xml located in the installation media folder configuration/samples/):
    <servlet-mapping>
      <servlet-name>imageTransformer</servlet-name>
      <url-pattern>/CUSTOM/PATH/*</url-pattern>
    </servlet-mapping>

    where /CUSTOM/PATH refers to the customized URL that you want the image transformer to run against. If you do not want to create a customized URL, set <url-pattern> to *.

  11. Save and close web.xml.
  12. If your Web application server is WebSphere, use the WebSphere administrative console to instruct your Web module classloaders to search for classes in the application first. To do so, set the Web module classloader mode to the value PARENT_LAST. For more information, refer to the following WebSphere documentation resource: Administer classloaders using the WebSphere administrative console.
  13. If your Web application server is WebSphere, in the folder WebSphere/Liberty/usr/servers/defaultServer/, do the following in the file server.xml:
    1. Check for the line <feature>javaee-7.0</feature> (in the featureManager section). If you see it, add the line <feature>cdi-1.0</feature> and save and close server.xml to commit your changes.
    2. Ensure that the file contains an applicationMonitor element with its updateTrigger attribute set to disabled.
  14. Start or restart the Web application.