title: Page redirection using Apache Camel
body: <p>I am trying to develop a route that redirects a user from page1 to page2.</p>
  
  <p>Route is triggered when user accesses the url :  <a href="http://localhost:8080/servlets/doSomething" rel="nofollow noreferrer">http://localhost:8080/servlets/doSomething</a> (page1)
  and I want it to be redirected to <a href="http://google.com" rel="nofollow noreferrer">http://google.com</a> for instance (page2)</p>
  
  <p>I have exposed a servlet in Camel :</p>
  
  <p>in web.xml :</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;camelServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.apache.camel.component.servlet.CamelHttpTransportServlet&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;camelServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/servlets/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>in  camel context :</p>
  
  <pre><code>&lt;camel:from uri="servlet://doSomething?servletName=camelServlet" /&gt;
  </code></pre>
  
  <p>I have tried to redirect using : </p>
  
  <pre><code>&lt;camel:to uri="http://google.com?bridgeEndpoint=true" /&gt;
  </code></pre>
  
  <p>But got java.net.ConnectException: Connection timed out: connect  </p>