camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > Servlet Tomcat Example
Date Wed, 02 Mar 2011 13:06:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2036/9/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/Servlet+Tomcat+Example">Servlet
Tomcat Example</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://cwiki.apache.org/confluence/display/~davsclaus">Claus
Ibsen</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <h2><a name="ServletTomcatExample-ServletTomcatExample"></a>Servlet
Tomcat Example</h2>
<p><b>Available as of Camel 2.7</b></p>

<p>This example is located in the <tt>examples/camel-example-servlet-tomcat</tt>
directory of the Camel distribution.<br/>
There is a <tt>README.txt</tt> file with instructions how to run it.</p>

<p>If you use maven then you can easily package the example from the command line:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn <span class="code-keyword">package</span>
</pre>
</div></div>

<h3><a name="ServletTomcatExample-About"></a>About</h3>

<p>This example demonstrates how you can use <a href="/confluence/display/CAMEL/SERVLET"
title="SERVLET">SERVLET</a> to expose a http service in Camel.</p>

<h3><a name="ServletTomcatExample-Implementation"></a>Implementation</h3>

<p>In the <tt>web.xml</tt> file in the <tt>src/main/webapp/WEB-INF</tt>
folder the CamelServlet is defined. This is mandatory to do when using the <a href="/confluence/display/CAMEL/SERVLET"
title="SERVLET">SERVLET</a> component.<br/>
TODO: e1</p>

<p>The route is a simple <a href="/confluence/display/CAMEL/Content+Based+Router"
title="Content Based Router">Content Based Router</a> defined in the DSL XML as shown:<br/>
TODO: e1</p>

<h3><a name="ServletTomcatExample-Runningtheexample"></a>Running the example</h3>

<p>This example runs in Apache Tomcat, so you will have to package the .war file and
copy it to the <tt>webapp</tt> folder of Tomcat, which is the hot deploy folder.</p>

<p><b>Note:</b> You have to use the version number of Camel you use. In
this documentation we are using 2.7.0.</p>

<p>There is a main page at: <tt><a href="http://localhost:8080/camel-example-servlet-tomcat-2.7.0"
class="external-link" rel="nofollow">http://localhost:8080/camel-example-servlet-tomcat-2.7.0</a></tt>
which has more instructions.<br/>
You can then use a web browser and send a request to the <tt><a href="http://localhost:8080/camel-example-servlet-tomcat-2.7.0/camel/hello"
class="external-link" rel="nofollow">http://localhost:8080/camel-example-servlet-tomcat-2.7.0/camel/hello</a></tt>
url. </p>

<h3><a name="ServletTomcatExample-SeeAlso"></a>See Also</h3>
<ul class="alternate" type="square">
	<li><a href="/confluence/display/CAMEL/Examples" title="Examples">Examples</a></li>
	<li><a href="/confluence/display/CAMEL/SERVLET" title="SERVLET">SERVLET</a></li>
	<li><a href="/confluence/display/CAMEL/HTTP" title="HTTP">HTTP</a></li>
</ul>

    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>
       <a href="https://cwiki.apache.org/confluence/display/CAMEL/Servlet+Tomcat+Example">View
Online</a>
              |
       <a href="https://cwiki.apache.org/confluence/display/CAMEL/Servlet+Tomcat+Example?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message