Loading catalog images from a custom location

By default, Management Center loads catalog images from the store directory within the Stores web application. You can customize the Management Center image servlet to retrieve and load images from a different location, such as when your store retrieves images from a different location.

Procedure

  1. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
  2. Expand LOBTools > WebContent > WEB-INF.
  3. Open the web.xml file for editing.
  4. Locate the code that configures the image servlet.
    
    <servlet>
      <description></description>
      <display-name></display-name>
      <icon>
        <small-icon></small-icon>
        <large-icon></large-icon>
      </icon>
      <servlet-name>ImageServlet</servlet-name>
      <servlet-class>com.ibm.commerce.foundation.client.lobtools.servlet.ImageServlet</servlet-class>
      <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet-mapping>
      <servlet-name>ImageServlet</servlet-name>
      <url-pattern>LoadImage</url-pattern>
    </servlet-mapping>
  5. Add the initialization parameter imageURLPrefix to configure the location where the servlet is to retrieve images.
    For example, the following code configures the servlet to retrieve and load images from the location http://myImageServletHost/webapp/wcs/stores/MyStoreName/
    
    <servlet>
      <description></description>
      <display-name></display-name>
      <icon>
        <small-icon></small-icon>
        <large-icon></large-icon>
      </icon>
      <servlet-name>ImageServlet</servlet-name>
      <servlet-class>com.ibm.commerce.foundation.client.lobtools.servlet.ImageServlet</servlet-class>
      <init-param>
        <param-name>imageURLPrefix</param-name>
        <param-value>http://myImageServletHost/webapp/wcs/stores/MyStoreName/</param-value>
      </init-param>
      <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet-mapping>
      <servlet-name>ImageServlet</servlet-name>
      <url-pattern>LoadImage</url-pattern>
    </servlet-mapping>
  6. Save and publish your changes.