Installing the Image Transformation servlet in a Java Web application
To make the Image Transformation servlet work in Java, first install the API Server Role, then add CID JAR files to it.
Procedure
- If you have not already done so, create a Java Web application containing the SDL Tridion Content Delivery Server Role called API. Refer to the SDL Tridion documentation to learn how.
- Access your CID installation media and navigate to Tridion\Contextual Image Delivery\java\lib\.
- From this location, copy the following files to the WEB-INF/lib/ folder of your Web application:
- cwd_image.jar
- cwd_resource.jar
- Navigate to Tridion\Contextual Image Delivery\java\third-party-lib\.
- Copy the following files to your Web application library location:
- commmons-codec.jar
- httpclient.jar
- httpcore.jar
- Do one of the following:
- If you use Context Engine Cartridge, access the library location of the Context Engine Cartridge Web application.
- If you do not use Context Engine Cartridge, access the SDL Tridion Hotfix 87801 zip file.
- Copy the following files from this location to your Web application library location:
- cwd_cartridge.jar
- cwd_engine.jar
- If you want to run the image transformer against a customized URL, access the WEB-INF/classes/ folder of your Web application.
- Open cd_ambient_conf.xml for editing.
- 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. - Save and close cd_ambient_conf.xml.
- In the WEB-INF/ folder of your Web application, open web.xml for editing.
- Create a new
servletsection 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> - Create a new
servlet-mappingsection 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*. - Save and close web.xml.
- 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. - Start or restart the Web application.