title: How to add REST channel to Spring Webflow Application?
body: <p>I've downloaded <strong>Spring Webflow</strong> sources and I wanted to add REST channel (displaying the image from database) to the <strong>jsf-booking</strong> sample. This channel was working without problem in my <strong>Spring-MVC</strong> sample application.</p>
  
  <p>However, I have problem with mapping, because on the given address the JSF handler is responding with error message that the display.xhtml file does not exist (and the REST listener should handle that request).</p>
  
  <p>This is how I registered the handler:</p>
  
  <pre><code>@Controller
  @RequestMapping(value="/image")
  public class ImageChannelImpl implements ImageChannel {
  
      @RequestMapping(value="/display.png", method=RequestMethod.GET)
      public void display(HttpServletResponse response) throws IOException {
  (...)
          response.setContentType("image/png");
          ImageIO.write(img, "PNG", response.getOutputStream());
          response.getOutputStream().flush();     
          log.debug("display finished");
      }
  </code></pre>
  
  <p>}</p>
  
  <p>I've copied the handler mapping;</p>
  
  <pre><code>&lt;bean
  
      class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"&gt;
      &lt;property name="messageConverters"&gt;
          &lt;util:list id="beanList"&gt;
              &lt;ref bean="stringHttpMessageConverter" /&gt;
              &lt;ref bean="byteArrayHttpMessageConverter" /&gt;
          &lt;/util:list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;bean id="stringHttpMessageConverter"
      class="org.springframework.http.converter.StringHttpMessageConverter" /&gt;
  
  &lt;bean id="byteArrayHttpMessageConverter"
      class="org.springframework.http.converter.ByteArrayHttpMessageConverter" /&gt;
  </code></pre>
  
  <p>The DispatcherServlet is listening on /spring/* requests:</p>
  
  <pre><code>&lt;!-- The front controller of this Spring Web application, responsible for handling all application requests --&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;Spring MVC Dispatcher Servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;2&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;!-- Map all /spring requests to the Dispatcher Servlet for handling --&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Spring MVC Dispatcher Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/spring/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>So, I have expected, that the image will be available on the address /spring/image/display.png, but the REST handler is not taking that request, neither it handles /image/display.png . </p>
  
  <p>So, what must be changed in that configuration so that the REST channel can be registered? I was trying to google any sample or documentation, how to configure both Spring WebFlow and Spring MVC channels, but I haven't found anything.</p>