title: How to configure CXF servlet outside of web.xml
body: <p>I want to be able to disable webservices using spring profile. I have surrounded all the cxf related beans with:</p>
  
  <pre><code>&lt;beans profile="webservices"&gt;...&lt;/beans&gt;
  </code></pre>
  
  <p>But what is left is cxf servlet in web.xml:</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;CXFServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.apache.cxf.transport.servlet.CXFServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;CXFServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/services/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>I'm thinking to replace it with:</p>
  
  <pre><code>&lt;servlet&gt;
  &lt;servlet-name&gt;webservicesDispatcher&lt;/servlet-name&gt;
  &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
  &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
  &lt;servlet-name&gt;webservicesDispatcher&lt;/servlet-name&gt;
  &lt;url-pattern&gt;/services/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>I need to configure webservicesDispather to do the same thing as the CXFServlet does. So far contents of webservicesDispatcher-servlet.xml looks like this:</p>
  
  <pre><code>&lt;beans xmlns="... &gt; 
      &lt;beans profile="webservices"&gt;    
       &lt;import resource="classpath:META-INF/cxf/cxf.xml" /&gt;
           &lt;import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /&gt;
           &lt;import resource="classpath:META-INF/cxf/cxf-servlet.xml" /&gt;    
      &lt;/beans&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>So, any idea what contents of webservicesDispatcher-servlet.xml should be?</p>