<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-8048745819635601540</atom:id><lastBuildDate>Wed, 04 Sep 2024 12:56:42 +0000</lastBuildDate><category>Java</category><category>Tips</category><category>NetBeans</category><category>xml</category><category>Web Services</category><category>JBoss</category><category>Ubuntu</category><category>IDE</category><category>MySQL</category><category>Quartz</category><category>UDDI</category><category>scheduler</category><category>spring</category><category>Artificial Intelligence</category><category>Axis</category><category>CFX</category><category>DesignPatterns</category><category>Drools</category><category>Eclipse</category><category>Rule Engine</category><category>SOA</category><category>SOAP</category><category>String Utility</category><category>Utils</category><category>camel</category><category>camel-jetty</category><category>hibernate</category><category>jars</category><category>restful webservice</category><category>web service</category><title>Java Wave</title><description>Useful Information about Java, Latest IDE&#39;s in market, Web services</description><link>http://javawave.blogspot.com/</link><managingEditor>noreply@blogger.com (Muthukumar Dhanagopal)</managingEditor><generator>Blogger</generator><openSearch:totalResults>38</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-1655261190504169202</guid><pubDate>Mon, 26 Nov 2012 18:16:00 +0000</pubDate><atom:updated>2012-11-26T10:35:15.114-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CFX</category><category domain="http://www.blogger.com/atom/ns#">NetBeans</category><category domain="http://www.blogger.com/atom/ns#">restful webservice</category><category domain="http://www.blogger.com/atom/ns#">spring</category><category domain="http://www.blogger.com/atom/ns#">web service</category><category domain="http://www.blogger.com/atom/ns#">Web Services</category><title>Restful webservice using CFX and Spring</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Create a new Maven Web project using Netbeans IDE. (Version used for this post is 7.3 beta3)&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPz8Cav_AJbeNabx2beu-jsavJ1usNqokxMU8O0PuIbUXBzioax-BsDt0XN-Lco3HR3UqXQKS8Kl5Dr_lGEkO5iH8NANbJc3qSn9BpD6qdLw41l5XU1lGjLMlNCd976ZAL-aGN4juXcEw/s1600/rest.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPz8Cav_AJbeNabx2beu-jsavJ1usNqokxMU8O0PuIbUXBzioax-BsDt0XN-Lco3HR3UqXQKS8Kl5Dr_lGEkO5iH8NANbJc3qSn9BpD6qdLw41l5XU1lGjLMlNCd976ZAL-aGN4juXcEw/s1600/rest.PNG&quot; height=&quot;275&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Run through the wizard to create the Maven Web Application. here i have given the name &quot;CFXSpring&quot; as the project name.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyK9fGsVCn0ayBofSV6CAsEalFBYnoCAMtuXSrZiKp7PM63R9gpSK7bLP7oaiQzbR0DXpVh2ReytToFcHw3QZiywiHu650b85cJ3bJDvUa1L654LY5pzJbcdi3PRqSDOsmXvH-Yzp0ZRw/s1600/rest.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyK9fGsVCn0ayBofSV6CAsEalFBYnoCAMtuXSrZiKp7PM63R9gpSK7bLP7oaiQzbR0DXpVh2ReytToFcHw3QZiywiHu650b85cJ3bJDvUa1L654LY5pzJbcdi3PRqSDOsmXvH-Yzp0ZRw/s1600/rest.PNG&quot; height=&quot;275&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;br /&gt;
3. In the next screen of the wizard select the server of your choice. &amp;nbsp;Here i have selected Glassfish server which comes bundled with Netbeans.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqKLsCbMSkYO4WN56L43VxPQkyguxCChpFVf2k0hDRsHyiBnPzZn99Q3cnFdDPoAYWmQrSrgFBF-dg0I9dP3fG7lbzM8LOZlXImQYiYYPndsRNfgquCUdFMgo15yquDFHlcS096es8B34/s1600/rest.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqKLsCbMSkYO4WN56L43VxPQkyguxCChpFVf2k0hDRsHyiBnPzZn99Q3cnFdDPoAYWmQrSrgFBF-dg0I9dP3fG7lbzM8LOZlXImQYiYYPndsRNfgquCUdFMgo15yquDFHlcS096es8B34/s1600/rest.PNG&quot; height=&quot;275&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;br /&gt;
4. Then click on finish, your project is ready to use. Here you can notice the following folder structure is created by Maven for you.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZsAaLG0PPIQmniJfuUQuSbJENMv_PGX2NUl2OThWAaXvsXqv2Vxed7xATqAED4OgX9go_bXNOhcW08kvd3UqFmrZbQYA7nhOTWFg_3aru3rAs313O_iHQFgFnznpe3gG-s4zd7Ba943M/s1600/rest.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZsAaLG0PPIQmniJfuUQuSbJENMv_PGX2NUl2OThWAaXvsXqv2Vxed7xATqAED4OgX9go_bXNOhcW08kvd3UqFmrZbQYA7nhOTWFg_3aru3rAs313O_iHQFgFnznpe3gG-s4zd7Ba943M/s1600/rest.PNG&quot; height=&quot;223&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;br /&gt;
5. Now its time to add Spring MVC Framework to our application. So right click on the project node in project window and go to properties menu item. IDE will pop up a properties window for you. In that window go to &quot;Frameworks&quot; categories. &amp;nbsp;In the right panel of the window you will get a empty text area with an &quot;Add&quot; button to its right. Just Click on the Add button.Another framework window will pop up with the list of frameworks works available to choose from. &amp;nbsp;Select Spring Web MVC from that window. &amp;nbsp;See the screen shot below for clarity.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8Ea1kUq1dMZGQYXojkICf4dbekqg8LsIGDQl1mjXnvGxrEtL2tp_SaZ0lm8HdwkFI8js92gejQnBkhK6j2k-tYKzcCSh15vFGKYUlxUMQZQFBRZhiPJOa0605gRSrE8lRAUEe1zIgJWw/s1600/rest.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8Ea1kUq1dMZGQYXojkICf4dbekqg8LsIGDQl1mjXnvGxrEtL2tp_SaZ0lm8HdwkFI8js92gejQnBkhK6j2k-tYKzcCSh15vFGKYUlxUMQZQFBRZhiPJOa0605gRSrE8lRAUEe1zIgJWw/s1600/rest.PNG&quot; height=&quot;288&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Now select the Spring Framework version you like to use with this application. &amp;nbsp;Here i have selected 2.5.6 to use with my application. &amp;nbsp;see the figure below.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDDxt-RzdjoehRBQ6I_g2adVZWYYSHZxE68-SWnmvG_43_ER9_bbzJTgdsAuuet-CVW1y_OP_TmTsvytzsn17GW7D110gxOphXxoTSIubwzXFqy3CB0WN8MnMGuhGP4q0nVyJJ-kN-T2o/s1600/rest.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDDxt-RzdjoehRBQ6I_g2adVZWYYSHZxE68-SWnmvG_43_ER9_bbzJTgdsAuuet-CVW1y_OP_TmTsvytzsn17GW7D110gxOphXxoTSIubwzXFqy3CB0WN8MnMGuhGP4q0nVyJJ-kN-T2o/s1600/rest.PNG&quot; height=&quot;288&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;br /&gt;
7. Once the above step is done. &amp;nbsp;Spring frame work will be added to the project by the IDE, by including the needed dependencies to the POM.XML file. By the way adding the dependencies to the project dependencies folder. see the figure below.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUUconNXlBg73zZvtRYxJR0huWEOFU76bDiDikNl5gBHsBKx1aKx9SdVvjiOi-Fu7VmV0Nw47vNKkC0xJqpdcM2qDSDJjOV7vjpEmhrHZAEbVlgOU-15shxLZCvVFWkCFzUIalA_93dVQ/s1600/rest.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUUconNXlBg73zZvtRYxJR0huWEOFU76bDiDikNl5gBHsBKx1aKx9SdVvjiOi-Fu7VmV0Nw47vNKkC0xJqpdcM2qDSDJjOV7vjpEmhrHZAEbVlgOU-15shxLZCvVFWkCFzUIalA_93dVQ/s1600/rest.PNG&quot; height=&quot;195&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;br /&gt;
8. Now you can see there is a change in the project folder structure also. &amp;nbsp;A new folder &quot;WEB-INF&quot; is added to the project. That folder will also contain &quot;applicationContext.xml&quot; which is nothing but the Spring Configuration file where we will be wiring our beans and bean dependencies through property or constrructer injection. also you can see &quot;web.xml&quot; which is nothing but the web applications deployment&amp;nbsp;descriptor.&lt;br /&gt;
&lt;br /&gt;
9. In &quot;web.xml&quot; you can see already &quot;org.springframework.web.servlet.DispatcherServlet&quot; is configured for you by the IDE. so no need for us to do any extra configuration with respect to spring.&lt;br /&gt;
&lt;br /&gt;
10. Now its time to add CFX dependencies to POM.XML. &amp;nbsp;This we will do manually with out using any of the IDE&#39;s wizards.&lt;br /&gt;
&lt;br /&gt;
11. Open the &quot;pom.xml&quot; file which will be located in the projectfiles folder of the project.&lt;br /&gt;
&lt;br /&gt;
12. Go to &quot;dependencies&quot; tag. and add the following dependency to it.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTyBxS18Tu8pE9TpqBfldXyzKrQEdxxgA438WJK35B6nPMzhcT94sYOhEdmtGHVgN6rRYOGko83l9lsRFFdDc7loZC9-ToFU5dALdUWxdNFlrR-8ZM2zasx109FMiO9uOSpN3viwCxhqA/s1600/rest.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&amp;lt;dependency&amp;gt;             &amp;lt;groupId&amp;gt;org.apache.cxf&amp;lt;/groupId&amp;gt;             &amp;lt;artifactId&amp;gt;cxf-rt-frontend-jaxrs&amp;lt;/artifactId&amp;gt;             &amp;lt;version&amp;gt;2.6.2&amp;lt;/version&amp;gt;         &amp;lt;/dependency&amp;gt;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTyBxS18Tu8pE9TpqBfldXyzKrQEdxxgA438WJK35B6nPMzhcT94sYOhEdmtGHVgN6rRYOGko83l9lsRFFdDc7loZC9-ToFU5dALdUWxdNFlrR-8ZM2zasx109FMiO9uOSpN3viwCxhqA/s1600/rest.PNG&quot; title=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
13. &amp;nbsp;Now select &quot;Clean and Build&quot; menu item by right clicking on the project node to build the project. Maven will now download the dependencies and pack it with the project. &amp;nbsp;You can now see the list of dependencies and the jar&#39;s added in the dependencies folder of the project to cross verify this.&lt;br /&gt;
&lt;br /&gt;
14. Now open the &quot;web.xml&quot;. Add &quot;org.apache.cxf.transport.servlet.CXFServlet&quot; and its corresponding&amp;nbsp;servlet-mapping URL like below.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZhalufGKK_xiD2E1TEgWHk0_SHEvuJCirHrdxFKQXJA4uG4g33_mQ3K8XtO-Qk92l6TJJJOcBkw3I5IcSJU8WBgUI-srWAZK87TJGrf2LQ0z1lBAB0zDpSRNxSkXpt94L7nO_NXaf620/s1600/rest.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZhalufGKK_xiD2E1TEgWHk0_SHEvuJCirHrdxFKQXJA4uG4g33_mQ3K8XtO-Qk92l6TJJJOcBkw3I5IcSJU8WBgUI-srWAZK87TJGrf2LQ0z1lBAB0zDpSRNxSkXpt94L7nO_NXaf620/s1600/rest.PNG&quot; height=&quot;168&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/blockquote&gt;
15. Now create a class called &quot;HelloService.java&quot; in the package &quot;com.mm.cfxspring.rs&quot;.&lt;br /&gt;
&lt;br /&gt;
16. Write a method to say hello as you wish. &amp;nbsp;See below for an example.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;package com.mm.cfxspring.rs;&lt;br /&gt;/**&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;* @author Muthu&lt;br /&gt;&amp;nbsp;*/&lt;br /&gt;public class HelloService {&lt;br /&gt;&amp;nbsp; &amp;nbsp; public String sayHello() {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return &quot;Hello JavaWave&quot;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
17. Now add the annotation to the above class to make it as restful web service. &amp;nbsp;To do so you have to add &quot;@Path(&quot;/hello&quot;)&quot; just above the class name to identify the resource by external clients. &quot;@GET&quot; above the method name to make the service HTTP GET enabled. and &quot;&amp;nbsp;@Produces(&quot;text/plain&quot;)&quot; to denote the service what the service has to produce to the client. &amp;nbsp;For more clarity see the example below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;package com.mm.cfxspring.rs;&lt;br /&gt;import javax.ws.rs.GET;&lt;br /&gt;import javax.ws.rs.Path;&lt;br /&gt;import javax.ws.rs.Produces;&lt;br /&gt;/**&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;* @author Muthu&lt;br /&gt;&amp;nbsp;*/&lt;br /&gt;@Path(&quot;/hello&quot;)&lt;br /&gt;public class HelloService {&lt;br /&gt;&amp;nbsp; &amp;nbsp; @GET&lt;br /&gt;&amp;nbsp; &amp;nbsp; @Produces(&quot;text/plain&quot;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; public String sayHello() {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return &quot;Hello JavaWave&quot;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;/span&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
18. Once it is done. Open &quot;applicationContext.xml&quot; file and add &quot;xmlns:jaxrs=&quot;http://cxf.apache.org/jaxrs&quot;&quot; name space to the name space list already added in the xml. and also add &quot;http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd&quot; xsd&#39;s to the schema location. see blow for clarity.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir1xvY-MI9NjEVAIIzZRIHemKYjVYENJ5r_UJD47sFoU2JcRpOalLbysxkYYIslg1cT0ydvTpsjsKQfJnVUQG54z5__NqMzofuMIMDtn77k9WJDQkh2aWMqw8AnkGZo0el-AsmYC_jLVQ/s1600/rest.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir1xvY-MI9NjEVAIIzZRIHemKYjVYENJ5r_UJD47sFoU2JcRpOalLbysxkYYIslg1cT0ydvTpsjsKQfJnVUQG54z5__NqMzofuMIMDtn77k9WJDQkh2aWMqw8AnkGZo0el-AsmYC_jLVQ/s1600/rest.PNG&quot; height=&quot;187&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
19. Now modify the applicationContext.xml by adding the rest service bean and also the reference HelloService bean to it like below.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCBDAYvmlIktCbx01FTjosCRqAEVDFq9Jz6GigwQXlWy_s-CnVTr4iAMsHnpoaZay2ay2Hb8qTIdN9vRbv75uOvw_MEqAGsNhbL9Sh26DE278ySWZ9HNKOo97krpQbRI5LegNEiYZd4gU/s1600/rest.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCBDAYvmlIktCbx01FTjosCRqAEVDFq9Jz6GigwQXlWy_s-CnVTr4iAMsHnpoaZay2ay2Hb8qTIdN9vRbv75uOvw_MEqAGsNhbL9Sh26DE278ySWZ9HNKOo97krpQbRI5LegNEiYZd4gU/s1600/rest.PNG&quot; height=&quot;208&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/blockquote&gt;
20. do a clean and build by right clicking the project node once the above steps are done.&lt;br /&gt;
&lt;br /&gt;
21. Now you can see a folder added in project called &quot;RESTful Web Service&quot; and it contains a service by name &quot;HelloService&quot; with path reference as &quot;/hello&quot;.&lt;br /&gt;
&lt;br /&gt;
22. To test our service run the project by right clicking the project none and selecting the run menu item. &lt;br /&gt;
&lt;br /&gt;
23. Once you hit the URL &quot;/hello&quot; with the proper port number, host name and context you will get the return string from your web service as expected.&lt;br /&gt;
&lt;br /&gt;
24. &amp;nbsp;The example shown in this blog will return &quot;Hello JavaWave&quot; as a plain text in the browser.&amp;nbsp;&lt;/div&gt;
</description><link>http://javawave.blogspot.com/2012/11/restful-webservice-using-cfx-and-spring.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPz8Cav_AJbeNabx2beu-jsavJ1usNqokxMU8O0PuIbUXBzioax-BsDt0XN-Lco3HR3UqXQKS8Kl5Dr_lGEkO5iH8NANbJc3qSn9BpD6qdLw41l5XU1lGjLMlNCd976ZAL-aGN4juXcEw/s72-c/rest.PNG" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-4849676346273251407</guid><pubDate>Wed, 14 Nov 2012 18:57:00 +0000</pubDate><atom:updated>2012-11-14T11:20:53.809-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">camel</category><category domain="http://www.blogger.com/atom/ns#">camel-jetty</category><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">NetBeans</category><title>Camel-Jetty Step by Step using Netbeans IDE</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;c7&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt;&quot;&gt;
&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;&lt;u&gt;&lt;b&gt;Camel-Jetty Step by Step using Netbeans IDE&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c5&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; height: 11pt;&quot;&gt;
&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c7&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt;&quot;&gt;
&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;1. Create a Maven Java project using Netbeans IDE (Version used - 7.3 beta2)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c5&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; height: 11pt;&quot;&gt;
&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol class=&quot;c10&quot; start=&quot;1&quot; style=&quot;font-family: arial, sans, sans-serif; list-style-type: disc; margin: 0px; padding: 0px;&quot;&gt;
&lt;li class=&quot;c0 c6&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 36pt; padding-left: 0pt;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;Go to New project wizard and&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas; font-size: 11pt;&quot;&gt;Create a new maven java project&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;c0 c6&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 36pt; padding-left: 0pt;&quot;&gt;&lt;img height=&quot;324&quot; src=&quot;https://docs.google.com/drawings/image?id=sJAXubBT0p9W8rcbChQRaGQ&amp;amp;rev=3&amp;amp;h=324&amp;amp;w=469&amp;amp;ac=1&quot; style=&quot;font-size: 11pt;&quot; width=&quot;469&quot; /&gt;&lt;/li&gt;
&lt;li class=&quot;c0 c6&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 36pt; padding-left: 0pt;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;Here for our sample the project is named as “MyHTTP”&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;c4&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; text-indent: 36pt;&quot;&gt;
&lt;img height=&quot;312&quot; src=&quot;https://docs.google.com/document/pubimage?id=1OjhbHUy2-i2On3ldaY9cYKJ-8CyeZtRL_DhlT3RrFLQ&amp;amp;image_id=15p0QeO3XmUoS532Zj_yfcRHv5z4NDVfc&quot; width=&quot;471&quot; /&gt;&lt;/div&gt;
&lt;ol class=&quot;c10&quot; start=&quot;4&quot; style=&quot;font-family: arial, sans, sans-serif; list-style-type: disc; margin: 0px; padding: 0px;&quot;&gt;
&lt;li class=&quot;c0 c6&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 36pt; padding-left: 0pt;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;Click on finish&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;c0 c6&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 36pt; padding-left: 0pt;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;now the IDE will create a Java Maven project for you with the recommended folder structure like below.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;c4&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; text-indent: 36pt;&quot;&gt;
&lt;img height=&quot;279&quot; src=&quot;https://docs.google.com/document/pubimage?id=1OjhbHUy2-i2On3ldaY9cYKJ-8CyeZtRL_DhlT3RrFLQ&amp;amp;image_id=1KLqSIrXCdljIJBOjGJ6QTcyJfsOLj2zi&quot; width=&quot;497&quot; /&gt;&lt;/div&gt;
&lt;ol class=&quot;c10&quot; start=&quot;6&quot; style=&quot;list-style-type: disc; margin: 0px; padding: 0px; text-align: left;&quot;&gt;
&lt;li class=&quot;c0 c6&quot; style=&quot;font-family: Arial; font-size: 11pt; margin-left: 36pt; padding-left: 0pt;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;Just check the POM.XML found inside the “ProjectFiles” folder. which will have the dependencies and plugin’s added automatically by the IDE. POM created for “MyHTTP” is shown below.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;!--&lt;br&gt;&lt;/span&gt;&lt;/font&gt;&lt;ol class=&quot;c10&quot; start=&quot;6&quot; style=&quot;list-style-type: disc; margin: 0px; padding: 0px; text-align: left;&quot;&gt;
&lt;/ol&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;p&gt;
&lt;font class=&quot;c2 c1&quot; color=&quot;#434343&quot; face=&quot;Consolas&quot; style=&quot;font-size: 8pt; font-style: italic;&quot;&gt;&lt;project data-blogger-escaped-span=&quot;span&quot; data-blogger-escaped-xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; data-blogger-escaped-xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;&gt;&lt;/project&gt;&lt;/font&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;p&gt;
&lt;font class=&quot;c2 c1&quot; color=&quot;#434343&quot; face=&quot;Consolas&quot; style=&quot;font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp;&lt;/font&gt;&lt;i style=&quot;font-size: 11pt;&quot;&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;mso-bidi-font-family:Arial;
color:#434343&quot;&gt;&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp;
xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp;
&lt;modelversion&gt;4.0.0&lt;/modelVersion&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &lt;groupid&gt;com.mm&lt;/groupId&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp;
&lt;artifactid&gt;MyHTTP&lt;/artifactId&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp;
&lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp;
&lt;packaging&gt;jar&lt;/packaging&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp;
&lt;name&gt;MyHTTP&lt;/name&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp;
&lt;url&gt;http://maven.apache.org&lt;/url&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;build&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;plugins&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &lt;plugin&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c1&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;groupid&gt;org.apache.maven.plugins&lt;/groupId&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;artifactid&gt;maven-compiler-plugin&lt;/artifactId&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;version&gt;2.3.2&lt;/version&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;configuration&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;source&gt;1.7&lt;/source&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;target&gt;1.7&lt;/target&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/configuration&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &lt;/plugin&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;/plugins&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/build&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;properties&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp;
&lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &lt;/properties&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &lt;dependencies&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;dependency&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;groupid&gt;junit&lt;/groupId&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;artifactid&gt;junit&lt;/artifactId&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;version&gt;3.8.1&lt;/version&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;scope&gt;test&lt;/scope&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/dependency&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&amp;nbsp; &lt;/dependencies&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;c3&quot; style=&quot;margin: 0in 0in 0.0001pt 1in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size:8.0pt;font-family:Consolas;
mso-bidi-font-family:Arial;color:#434343&quot;&gt;&lt;/project&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;p&gt;
&lt;font class=&quot;c2 c1&quot; color=&quot;#434343&quot; face=&quot;Consolas&quot; style=&quot;font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/font&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;p&gt;
&lt;font class=&quot;c2 c1&quot; color=&quot;#434343&quot; face=&quot;Consolas&quot; style=&quot;font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp;--&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c5&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; height: 11pt;&quot;&gt;
&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVdbShKdCqKPyE8UJuM-RoOHqWhPJtKdW8ZqEyoSkT4ICGnMtlXLgM5OpP8a5k6PxTcT3kLZJtPGUM8G0VQeuCDaHaVaXcPiH0T1D-x_bsZEMzHVHsmB1kRll0RmiadEL93LeJJmTzkIg/s1600/pom.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;470&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVdbShKdCqKPyE8UJuM-RoOHqWhPJtKdW8ZqEyoSkT4ICGnMtlXLgM5OpP8a5k6PxTcT3kLZJtPGUM8G0VQeuCDaHaVaXcPiH0T1D-x_bsZEMzHVHsmB1kRll0RmiadEL93LeJJmTzkIg/s640/pom.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ol class=&quot;c10&quot; start=&quot;7&quot; style=&quot;font-family: arial, sans, sans-serif; list-style-type: disc; margin: 0px; padding: 0px;&quot;&gt;
&lt;li class=&quot;c0 c6&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 36pt; padding-left: 0pt;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;Now its time to add Camel dependencies to our POM.XML file. add the following dependencies to your pom.xml file inside the dependencies tag.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;c0&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 36pt;&quot;&gt;
&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&lt;dependency&gt;&lt;/dependency&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c0&quot; style=&quot;direction: ltr; margin-left: 36pt;&quot;&gt;
&lt;div style=&quot;font-family: Arial; font-size: 11pt;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2V77VA6juqEFyaxw2bY2rMc0X9tCqAx_RgMepVSPv_cUYwSEqdZcMrzcPw6UOqK4RtZEKRvqFzt__TNNPvBZtZi0va_VMt6T4mK9p_WohFmEYfMGQg2i0IeZPeBDLx_mwYz7eG9YB-WY/s1600/dep.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2V77VA6juqEFyaxw2bY2rMc0X9tCqAx_RgMepVSPv_cUYwSEqdZcMrzcPw6UOqK4RtZEKRvqFzt__TNNPvBZtZi0va_VMt6T4mK9p_WohFmEYfMGQg2i0IeZPeBDLx_mwYz7eG9YB-WY/s1600/dep.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;c0&quot; style=&quot;margin: 0in 0in 0in 0.5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;c0&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in;&quot;&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;c2&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #434343; font-family: Consolas; font-size: 8.0pt; mso-bidi-font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, sans-serif; font-size: 11pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;c0&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 36pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c0 c8&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; height: 11pt; margin-left: 36pt;&quot;&gt;
&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol class=&quot;c10&quot; start=&quot;8&quot; style=&quot;font-family: arial, sans, sans-serif; list-style-type: disc; margin: 0px; padding: 0px;&quot;&gt;
&lt;li class=&quot;c0 c6&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 36pt; padding-left: 0pt;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;Once the dependencies are added just clean and build your project. so that maven will download the required jar files listed in the dependencies tag to your project from the central repository. and also will pack the required JAR files to your “\MyHTTP\target\” path with name “MyHTTP-1.0-SNAPSHOT.jar”.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;c0 c6&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 36pt; padding-left: 0pt;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;Now in your project you can see a main class created with the name “App.java”.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;c0 c6&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 36pt; padding-left: 0pt;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;its time to edit the java class App.java and add the following code to it.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;package com.mm.myhttp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3 c8&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; height: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;import java.util.logging.Level;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;import java.util.logging.Logger;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;import javax.servlet.http.HttpServletRequest;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;import org.apache.camel.Exchange;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;import org.apache.camel.Processor;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;import org.apache.camel.builder.RouteBuilder;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;import org.apache.camel.impl.DefaultCamelContext;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3 c8&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; height: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3 c8&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; height: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp;*&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp;* @author Muthu&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;public class App {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3 c8&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; height: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; public static void main(String[] args) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DefaultCamelContext camelContext = new DefaultCamelContext();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; camelContext.addRoutes(new RouteBuilder() {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Override&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void configure() throws Exception {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; from(&quot;jetty:http://0.0.0.0/myapp/myservice/?sessionSupport=true&quot;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .process(new Processor() {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Override&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void process(Exchange exchng) throws Exception {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Inside process exchange&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String body = exchng.getIn().getBody(String.class);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // this is the way to access HttpServletRequest&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HttpServletRequest req =&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; exchng.getIn().getBody(HttpServletRequest.class);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // send a html response back to client&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; exchng&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .getOut()&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .setBody(&quot;&lt;html&gt;&lt;body&gt;&quot;&lt;/body&gt;&lt;/html&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + &quot;Simple Demo for Camel-Jetty component&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + &quot;&lt;/span&gt;&lt;/div&gt;
&quot;);&lt;br /&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; camelContext.start();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (Exception ex) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c3&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 72pt;&quot;&gt;
&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;c7&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;c5&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; height: 11pt;&quot;&gt;
&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol class=&quot;c10&quot; start=&quot;11&quot; style=&quot;font-family: arial, sans, sans-serif; list-style-type: disc; margin: 0px; padding: 0px;&quot;&gt;
&lt;li class=&quot;c0 c6&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 36pt; padding-left: 0pt;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;the important part of the code is “&lt;/span&gt;&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;from(&quot;jetty:&lt;/span&gt;&lt;span class=&quot;c1 c12&quot; style=&quot;color: #1155cc; font-family: Consolas; font-size: 8pt; font-style: italic; text-decoration: underline;&quot;&gt;&lt;a class=&quot;c11&quot; href=&quot;http://0.0.0.0/myapp/myservice/?sessionSupport=true&quot; style=&quot;text-decoration: inherit;&quot;&gt;http://0.0.0.0/myapp/myservice/?sessionSupport=true&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;c2 c1&quot; style=&quot;color: #434343; font-family: Consolas; font-size: 8pt; font-style: italic;&quot;&gt;&quot;)&lt;/span&gt;&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;” from route which starts jetty server and listens to the http url mentioned in the from route.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;c0 c6&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 36pt; padding-left: 0pt;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;then the route flows to the process where a html response is set to the body and returned to the client.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;c0 c6&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 36pt; padding-left: 0pt;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;To test this application, just run the Java Maven project with App.java as the main class.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;c4&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; text-indent: 36pt;&quot;&gt;
&lt;img height=&quot;233&quot; src=&quot;https://docs.google.com/document/pubimage?id=1OjhbHUy2-i2On3ldaY9cYKJ-8CyeZtRL_DhlT3RrFLQ&amp;amp;image_id=1yCHfnoL54fUUCaZ7WREaVj14TdZQfkcu&quot; width=&quot;236&quot; /&gt;&lt;/div&gt;
&lt;ol class=&quot;c10&quot; start=&quot;14&quot; style=&quot;font-family: arial, sans, sans-serif; list-style-type: disc; margin: 0px; padding: 0px;&quot;&gt;
&lt;li class=&quot;c0 c6&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 36pt; padding-left: 0pt;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;In the Output window you can see the http service running at port 80. and our component uses Jetty-7.5.4 to run the service.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;c7&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt;&quot;&gt;
&lt;img height=&quot;255&quot; src=&quot;https://docs.google.com/document/pubimage?id=1OjhbHUy2-i2On3ldaY9cYKJ-8CyeZtRL_DhlT3RrFLQ&amp;amp;image_id=1ZtMHV1WEnB8fE-OxQvlpUrB4VB1oquGj&quot; width=&quot;656&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;c5&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; height: 11pt;&quot;&gt;
&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol class=&quot;c10&quot; start=&quot;15&quot; style=&quot;font-family: arial, sans, sans-serif; list-style-type: disc; margin: 0px; padding: 0px;&quot;&gt;
&lt;li class=&quot;c0 c6&quot; style=&quot;direction: ltr; font-family: Arial; font-size: 11pt; margin-left: 36pt; padding-left: 0pt;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;font-family: Consolas;&quot;&gt;Now hit the url(http://localhost/myapp/myservice/) using your browser and you should be able to see the html response back from the service.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</description><link>http://javawave.blogspot.com/2012/11/camel-jetty-step-by-step-using-netbeans.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVdbShKdCqKPyE8UJuM-RoOHqWhPJtKdW8ZqEyoSkT4ICGnMtlXLgM5OpP8a5k6PxTcT3kLZJtPGUM8G0VQeuCDaHaVaXcPiH0T1D-x_bsZEMzHVHsmB1kRll0RmiadEL93LeJJmTzkIg/s72-c/pom.PNG" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-1388330908386483938</guid><pubDate>Mon, 04 May 2009 05:36:00 +0000</pubDate><atom:updated>2009-05-03T22:40:28.934-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">String Utility</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><category domain="http://www.blogger.com/atom/ns#">Utils</category><title>Convert a String to Lower Case in Java</title><description>Here this post will show you how to convert a string to lower case in Java. &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;String actualValue = &quot;JAVA WAVE&quot;;  &lt;br /&gt;  &lt;br /&gt;String lowerCase = actualValue.toLowerCase();&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;</description><link>http://javawave.blogspot.com/2009/05/convert-string-to-lower-case-in-java.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-9008221090730650907</guid><pubDate>Tue, 10 Mar 2009 05:30:00 +0000</pubDate><atom:updated>2009-03-09T22:33:05.534-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><title>Generate a unique identifier with java.util.UUID</title><description>&lt;span style=&quot;font-weight:bold;&quot;&gt;Java SE 5 has introduced the java.util.UUID class to easily generate Universally Unique Identifier (UUID)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import java.util.UUID;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * This class is used to generate UUID and return it as a String object&lt;br /&gt; * &lt;br /&gt; * @author dhanago&lt;br /&gt; * &lt;br /&gt; */&lt;br /&gt;public class GenerateUUID&lt;br /&gt;{&lt;br /&gt;    /**&lt;br /&gt;     * method to return UUID as a String object&lt;br /&gt;     * &lt;br /&gt;     * @return&lt;br /&gt;     */&lt;br /&gt;    public static String getUUID()&lt;br /&gt;    {&lt;br /&gt; return UUID.randomUUID().toString();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;</description><link>http://javawave.blogspot.com/2009/03/generate-unique-identifier-with.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-8488104082741997256</guid><pubDate>Wed, 04 Mar 2009 06:40:00 +0000</pubDate><atom:updated>2009-03-03T22:41:26.626-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><title>Java utility to read from resource bundle or properties file</title><description>&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * dataSource.properties is loaded to a resource bundle.&lt;br /&gt;     */&lt;br /&gt;    public static ResourceBundle resourceBundle = ResourceBundle.getBundle(&lt;br /&gt;            &quot;sample.prop.health&quot;);&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * This method will return the value of the property from the resource&lt;br /&gt;     * bundle.&lt;br /&gt;     *&lt;br /&gt;     * @param key&lt;br /&gt;     *            property key&lt;br /&gt;     * @return property value&lt;br /&gt;     */&lt;br /&gt;    public static String getProperty(String key)&lt;br /&gt;    {&lt;br /&gt;        String value = null;&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            value = resourceBundle.getString(key);&lt;br /&gt;        }&lt;br /&gt;        catch (MissingResourceException missingResourceException)&lt;br /&gt;        {&lt;br /&gt;            Logger.getLogger(Utility.class.getName()).&lt;br /&gt;                    log(Level.SEVERE,&lt;br /&gt;                    &quot;Resource Bundle not found&quot;,&lt;br /&gt;                    missingResourceException);&lt;br /&gt;        }&lt;br /&gt;        return value;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;</description><link>http://javawave.blogspot.com/2009/03/java-utility-to-read-from-resource.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-1513380325595158694</guid><pubDate>Wed, 04 Mar 2009 06:37:00 +0000</pubDate><atom:updated>2009-03-03T22:38:59.896-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><title>Java method to format the current date to yyyy-MM-dd using SimpleDateFormat.</title><description>&lt;pre&gt;&lt;br /&gt;    /**&lt;br /&gt;     * This method will format the current date to yyyy-MM-dd.&lt;br /&gt;     * @return&lt;br /&gt;     *      current date as String.&lt;br /&gt;     */&lt;br /&gt;    public static String formatedCurrentDate()&lt;br /&gt;    {&lt;br /&gt;        String toDate = new Date().toString();&lt;br /&gt;        SimpleDateFormat formatter = new SimpleDateFormat(&lt;br /&gt;                &quot;EEE MMM yyyy hh:mm:ss zzz&quot;);&lt;br /&gt;        Date date = formatter.parse(toDate,&lt;br /&gt;                new ParsePosition(0));&lt;br /&gt;&lt;br /&gt;        toDate = new SimpleDateFormat(&quot;yyyy-MM-dd&quot;).format(date);&lt;br /&gt;        return toDate;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;</description><link>http://javawave.blogspot.com/2009/03/java-method-to-format-current-date-to.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-5660228247246989612</guid><pubDate>Wed, 04 Mar 2009 06:27:00 +0000</pubDate><atom:updated>2009-03-03T22:29:22.220-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><title>Java method to return a File object from the file path specified</title><description>&lt;pre&gt;&lt;br /&gt;    /**&lt;br /&gt;     * This method will return a file from the path specified.&lt;br /&gt;     *&lt;br /&gt;     * @param path&lt;br /&gt;     *            path of the file name.&lt;br /&gt;     * @param fileName&lt;br /&gt;     *            Name of the file.&lt;br /&gt;     * @return File object&lt;br /&gt;     */&lt;br /&gt;    public static File readFileFromPath(String path, String fileName)&lt;br /&gt;    {&lt;br /&gt;        String fileNameWithPath = null;&lt;br /&gt;        if (path.endsWith(&quot;/&quot;))&lt;br /&gt;        {&lt;br /&gt;            fileNameWithPath = path + fileName;&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            fileNameWithPath = path + &quot;/&quot; + fileName;&lt;br /&gt;        }&lt;br /&gt;        File file = new File(fileNameWithPath);&lt;br /&gt;&lt;br /&gt;        return file;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;</description><link>http://javawave.blogspot.com/2009/03/java-method-to-return-file-object-from.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-4371942812228623271</guid><pubDate>Wed, 04 Mar 2009 06:24:00 +0000</pubDate><atom:updated>2009-03-03T22:26:12.628-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><title>Reading file as String in Java</title><description>&lt;pre&gt;&lt;br /&gt;    /** This method will read a file as String&lt;br /&gt;     * @param filePath&lt;br /&gt;     * @return file as String&lt;br /&gt;     * @throws java.io.IOException&lt;br /&gt;     */&lt;br /&gt;    public static String readFileAsString(String filePath)&lt;br /&gt;            throws java.io.IOException&lt;br /&gt;    {&lt;br /&gt;        StringBuffer fileData = new StringBuffer(1000);&lt;br /&gt;        BufferedReader reader = new BufferedReader(new FileReader(filePath));&lt;br /&gt;        char[] buf = new char[1024];&lt;br /&gt;        int numRead = 0;&lt;br /&gt;        while ((numRead = reader.read(buf)) != -1)&lt;br /&gt;        {&lt;br /&gt;            String readData = String.valueOf(buf,&lt;br /&gt;                    0,&lt;br /&gt;                    numRead);&lt;br /&gt;            fileData.append(readData);&lt;br /&gt;            buf = new char[1024];&lt;br /&gt;        }&lt;br /&gt;        reader.close();&lt;br /&gt;        return fileData.toString();&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;</description><link>http://javawave.blogspot.com/2009/03/reading-file-as-string-in-java.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-2117484138611298227</guid><pubDate>Wed, 04 Mar 2009 06:17:00 +0000</pubDate><atom:updated>2009-03-03T22:22:47.879-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><title>Java method to replace every occurences of a string within another string</title><description>&lt;pre&gt;&lt;br /&gt;    /**&lt;br /&gt;     * This method will replace every occurences of a string within another&lt;br /&gt;     * string.&lt;br /&gt;     *&lt;br /&gt;     * @param target&lt;br /&gt;     *          is the original string&lt;br /&gt;     * @param from&lt;br /&gt;     *          is the string to be replaced&lt;br /&gt;     * @param to&lt;br /&gt;     *          is the string which will used to replace&lt;br /&gt;     * @return&lt;br /&gt;     *          changed new string&lt;br /&gt;     */&lt;br /&gt;    public static String replace(String target, String from, String to)&lt;br /&gt;    {&lt;br /&gt;        int start = target.indexOf(from);&lt;br /&gt;        if (start == -1)&lt;br /&gt;        {&lt;br /&gt;            return target;&lt;br /&gt;        }&lt;br /&gt;        int fromLength = from.length();&lt;br /&gt;        char[] targetChars = target.toCharArray();&lt;br /&gt;        StringBuffer buffer = new StringBuffer();&lt;br /&gt;        int copyFrom = 0;&lt;br /&gt;        while (start != -1)&lt;br /&gt;        {&lt;br /&gt;            buffer.append(targetChars,&lt;br /&gt;                    copyFrom,&lt;br /&gt;                    start - copyFrom);&lt;br /&gt;            buffer.append(to);&lt;br /&gt;            copyFrom = start + fromLength;&lt;br /&gt;            start = target.indexOf(from,&lt;br /&gt;                    copyFrom);&lt;br /&gt;        }&lt;br /&gt;        buffer.append(targetChars,&lt;br /&gt;                copyFrom,&lt;br /&gt;                targetChars.length - copyFrom);&lt;br /&gt;        return buffer.toString();&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;</description><link>http://javawave.blogspot.com/2009/03/java-method-to-replace-every-occurences.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-8981775674905512891</guid><pubDate>Tue, 02 Dec 2008 08:15:00 +0000</pubDate><atom:updated>2008-12-02T00:28:26.996-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><title>Converting Java String to double</title><description>&lt;span style=&quot;font-weight: bold;&quot;&gt;The following code will convert Java String into double data type.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package com.javaWave.blogSpot;&lt;br /&gt;&lt;br /&gt;public class String2double {&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * @param args&lt;br /&gt;  */&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;  // String myString = &quot;javaWave&quot;; // do this if you want an exception&lt;br /&gt;&lt;br /&gt;  String myString = &quot;100.00&quot;;&lt;br /&gt;&lt;br /&gt;  try {&lt;br /&gt;   double convertedValue = &lt;br /&gt;    Double.valueOf(myString.trim()).doubleValue();&lt;br /&gt;   System.out.println(&quot;convertedValue = &quot; + convertedValue);&lt;br /&gt;  } catch (NumberFormatException nfe) {&lt;br /&gt;   System.out.println(&quot;NumberFormatException: &quot; &lt;br /&gt;     + nfe.getMessage());&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;</description><link>http://javawave.blogspot.com/2008/12/converting-java-string-to-double.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-3196745170777268412</guid><pubDate>Sun, 10 Aug 2008 16:59:00 +0000</pubDate><atom:updated>2008-08-10T10:05:26.094-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">hibernate</category><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">NetBeans</category><title>Hibernate support in Netbeans IDE 6.1</title><description>&lt;a href=&quot;http://www.netbeans.tv/screencasts/Hibernate-Support-in-the-NetBeans-IDE-370/&quot;&gt;http://www.netbeans.tv/screencasts/Hibernate-Support-in-the-NetBeans-IDE-370/&lt;/a&gt;</description><link>http://javawave.blogspot.com/2008/08/hibernate-support-in-netbeans-ide-61.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-985721734158158028</guid><pubDate>Sat, 26 Jul 2008 13:56:00 +0000</pubDate><atom:updated>2008-07-26T07:33:24.728-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><title>Core Java Notes- Part I</title><description>&lt;strong&gt;Designing a class&lt;/strong&gt;:&lt;br /&gt;Think about objects created from the class.&lt;br /&gt;· Things the object knows about itself-&gt; instance variable&lt;br /&gt;· Things the object does-&gt; methods.&lt;br /&gt;&lt;em&gt;Note: think of instance as another way of saying object.&lt;/em&gt;&lt;br /&gt;&lt;strong&gt;Difference between a class and a object&lt;/strong&gt;:&lt;br /&gt;&lt;em&gt;Note: a class is not an object&lt;/em&gt;&lt;br /&gt;-&gt;class is used to construct an object&lt;br /&gt;A class is an blueprint for an object&lt;br /&gt;-&gt; tells the virtual machine how to make an object of the particular type.&lt;br /&gt;Example: An object is like one entry in your address book.&lt;br /&gt;&lt;strong&gt;The two uses of main&lt;/strong&gt;:&lt;br /&gt;1. To test your real class.&lt;br /&gt;2. To launch/ start your java application.&lt;br /&gt;&lt;strong&gt;The Heap&lt;/strong&gt;&lt;br /&gt;Each time an object is created in java, it goes into an area of memory known as the Heap. All objects created live on the heap.&lt;br /&gt;&lt;em&gt;Note: The java heap is actually called as Garbage collectable heap.&lt;/em&gt;&lt;br /&gt;Java manages the memory for you. When the JVM can see that an object can never be used again, that object becomes eligible for garbage collection. And if you are running low on memory, the garbage collector will run, throw out the unreachable objects, and free up the space, so that the space can be reused.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Marking a method as public and static&lt;/strong&gt;:&lt;br /&gt;Marking a method as public and static makes it behave much like a ‘global’.&lt;br /&gt;&lt;em&gt;Note: Any code in any class of your application can access a public static method.&lt;/em&gt;&lt;br /&gt;If you mark a variable as public, static and final, you have essentially made a globally available constant.&lt;br /&gt;&lt;strong&gt;Variables&lt;/strong&gt;&lt;br /&gt;2 flavours of variables,&lt;br /&gt;· Primitive&lt;br /&gt;· Reference&lt;br /&gt;&lt;strong&gt;Primitive&lt;/strong&gt;: Hold fundamental values including integers, Booleans and floating point numbers.&lt;br /&gt;&lt;strong&gt;Object references&lt;/strong&gt;: hold, well, references to objects.&lt;br /&gt;&lt;strong&gt;Two declare a variable you must follow two rules&lt;/strong&gt;:&lt;br /&gt;1. variables must have a type.&lt;br /&gt;2. variables must have a name.&lt;br /&gt;&lt;em&gt;Example&lt;/em&gt;:&lt;br /&gt;int count&lt;br /&gt;here,&lt;br /&gt;int ==&gt; Type, and&lt;br /&gt;count ==&gt; Name.&lt;br /&gt;&lt;em&gt;Note: A variable is just a container that holds something&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;You can assign a value to a variable in one of several ways including&lt;/strong&gt;:&lt;br /&gt;&gt; Type a literal value after the equal sign, eg., x=12, isgod=true; etc.,&lt;br /&gt;&gt; assign the value of one variable to another (x=y).&lt;br /&gt;&gt; use an expression combining the two. Eg.(x=y+43).&lt;br /&gt;&lt;em&gt;Note: You need a name and a type for your variables&lt;/em&gt;&lt;br /&gt;int size = 32&lt;br /&gt;here ,&lt;br /&gt;int ==&gt; Type,&lt;br /&gt;size ==&gt; Name, and&lt;br /&gt;32 ==&gt; Literal&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Safe naming rules for a class method or variable&lt;/strong&gt;:&lt;br /&gt;· it must start with a letter, underscore(_), or dollar sign($).you can’t start a name with a number.&lt;br /&gt;· After the first character you can use the number as well.&lt;br /&gt;· It can be anything you like, subject to those two rules, just so long as it isn’t one of java’s reserved words.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Reserved words Table:&lt;/strong&gt;&lt;br /&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5227325433590089730&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 481px; CURSOR: hand; HEIGHT: 46px; TEXT-ALIGN: center&quot; height=&quot;104&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiNn6QRWHFwx_v9LlxN2371vPZH3cKaz-i0qBhtqxKXr4y1G4XnyfWMeGyCxKgqyftYMDZralhsnvXVvD79PgiKhixb7-P3ouReJkV9UaawCXYr_x9nwwolsM8etrj5cr5fiU3enNl9XM/s320/reserved+words.png&quot; width=&quot;499&quot; border=&quot;0&quot; /&gt; &lt;strong&gt;Non-Primitive Variables/Objects&lt;/strong&gt;:&lt;br /&gt;There is actually no such thing as an object variables&lt;br /&gt;There is only an object reference variable.&lt;br /&gt;An object reference variable holds bits that representation way to access an object. And the JVM knows how to use the reference to get to the object.&lt;br /&gt;&lt;em&gt;Note: Objects live in one place-the garbage collectible heap!&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Arrays&lt;/strong&gt;&lt;/em&gt;: Arrays are always objects, whether they are declared to hold primitives or object references.&lt;br /&gt;&lt;em&gt;Note: once you have declared an array, you can’t put anything in it except things that are of the declared array type.&lt;br /&gt;&lt;/em&gt;&lt;strong&gt;Bullet Points&lt;/strong&gt;:&lt;br /&gt;Variables come in two flavours,&lt;br /&gt;1. Primitive&lt;br /&gt;2. Reference&lt;br /&gt;Variables must always be declared with a name and a type.&lt;br /&gt;A primitive variable value is the bits representing a way to get to an object on the heap.&lt;br /&gt;A reference variable is like a remote control using the dot operator (.) on a reference variable is like pressing a button on the remote control to access a method or instance variable.&lt;br /&gt;A reference variable has a value of null when it is not referencing any object.&lt;br /&gt;An array is always an object, even if the array is declared to hold primitives. There is no such thing as a primitive array, only an array that holds primitives&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Note: Java is pass-by-value (i.e) pass-by-copy.&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Bullet Points&lt;/strong&gt;:&lt;br /&gt;· Classes define what an object knows and what an object does.&lt;br /&gt;· Things an object knows are its instance variables(state).&lt;br /&gt;· Things an object does are its methods(behaviour).&lt;br /&gt;· Methods can use instance variables so that objects of the same type can behave differently.&lt;br /&gt;· A method can have parameters, which means you can pass one or more values into the method.&lt;br /&gt;· The number and type of values you pass in must match the order and type of the parameters declared by the method.&lt;br /&gt;· Values passed in and out of methods can be implicitly promoted to a larger type or explicitly cast to a smaller type.&lt;br /&gt;· The value you pass as an argument to a method can be a literal value (2, ‘c’,etc) or a variable of the declared parameter type (for example, x where x is an int variable).&lt;br /&gt;· A method must declare a return type. A void return type means the method doesn’t return type.&lt;br /&gt;&lt;strong&gt;Encapsulation ==&gt; Hide the data&lt;/strong&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Rule of thumb&lt;/em&gt;&lt;/strong&gt;: Mark your instance variables private and provide public getters and setters for access control.&lt;br /&gt;&lt;strong&gt;The difference between instance and local variable&lt;/strong&gt;.&lt;br /&gt;instance variable are declared inside a class but not within a method.&lt;br /&gt;local variables are declared within a method.&lt;br /&gt;local variables must be initialized before use.&lt;br /&gt;&lt;em&gt;Note: Local variables do not get a default value! The compiler complains if you try to use a local variable before the variable is initialized.&lt;br /&gt;Note: Method parameters are virtually the same as local variables. But method parameters will never get a compiler error telling you that a parameter variable might not have been initialized.&lt;br /&gt;&lt;/em&gt;</description><link>http://javawave.blogspot.com/2008/07/core-java-notes-part-i.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiNn6QRWHFwx_v9LlxN2371vPZH3cKaz-i0qBhtqxKXr4y1G4XnyfWMeGyCxKgqyftYMDZralhsnvXVvD79PgiKhixb7-P3ouReJkV9UaawCXYr_x9nwwolsM8etrj5cr5fiU3enNl9XM/s72-c/reserved+words.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-6529806886811471198</guid><pubDate>Mon, 14 Apr 2008 15:54:00 +0000</pubDate><atom:updated>2008-04-14T10:27:06.053-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Quartz</category><category domain="http://www.blogger.com/atom/ns#">scheduler</category><title>Quartz Job Scheduler -- Part II (Example, Simple Trigger)</title><description>In this example we will see how to implement a Simple scheduler with the help of Quartz Framework.&lt;br /&gt;&lt;br /&gt;Our application will just print Hello World on console after specified time.&lt;br /&gt;&lt;br /&gt;For implementing the scheduler using quartz we need two classes.&lt;br /&gt;1.  which will implement &lt;span style=&quot;font-style: italic;&quot;&gt;org.quartz.Job&lt;/span&gt; interface, and the other&lt;br /&gt;2.  the scheduler class which will start the scheduler.&lt;br /&gt;&lt;br /&gt;Now we will see the code which will implement Job interface:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;package com.MyQuartz.simple;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;import java.util.Date;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;import org.quartz.Job;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;import org.quartz.JobExecutionContext;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;import org.quartz.JobExecutionException;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt; * @author dhanago&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt; */&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;public class HelloJob implements Job {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;    public void execute(JobExecutionContext jobExecutionContext)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;            throws JobExecutionException {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;        System.out.println(&quot;Hello World -- Executed on : &quot; + new Date());&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here,&lt;br /&gt;    execute() --&gt; is an overridden method. When ever Job interface is implemented its execute() of method should be overridden. &lt;span style=&quot;font-style: italic;&quot;&gt;Note that any component you want to schedule should implement Job interface.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    JobExecutionContext --&gt; is passed as an parameter to the execute() method. this provides the job instance which provides the job instance with information about its run-time environment. From this we will get the job detail information and also some important information regarding its triggers etc.,&lt;br /&gt;&lt;br /&gt;Now we will see the code which will start the scheduler:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;package com.MyQuartz.simple;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;import java.util.Date;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;import java.util.logging.Level;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;import java.util.logging.Logger;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;import org.quartz.JobDetail;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;import org.quartz.Scheduler;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;import org.quartz.SchedulerException;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;import org.quartz.SimpleTrigger;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;import org.quartz.impl.StdSchedulerFactory;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt; * @author dhanago&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt; */&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;public class StartScheduler {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;    public void startScheduler()&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;            throws SchedulerException {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;        Scheduler scheduler = new StdSchedulerFactory().getScheduler();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;        scheduler.start();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;        JobDetail jobDetail = new JobDetail(&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;                &quot;MyJob&quot;, scheduler.DEFAULT_GROUP, HelloJob.class);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;        SimpleTrigger simpleTrigger = new SimpleTrigger(&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;                &quot;MyTrigger&quot;, scheduler.DEFAULT_GROUP, new Date(),&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;                null, SimpleTrigger.REPEAT_INDEFINITELY, 60L * 1000L);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;        scheduler.scheduleJob(jobDetail, simpleTrigger);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;    public static void main(String args[]) {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;        StartScheduler startScheduler = new StartScheduler();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;        try {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;            startScheduler.startScheduler();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;        catch (SchedulerException ex) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;            Logger.getLogger(StartScheduler.class.getName()).&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;                    log(Level.SEVERE, null, ex);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 153, 153);&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here,&lt;br /&gt;&lt;br /&gt;&lt;p style=&quot;font-family: arial; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;    &lt;/b&gt;StdSchedulerFactory():&lt;b&gt; &lt;/b&gt;A Class StdSchedulerFactory is a class and it is implementation of SchedulerFactory interface. Here it just using for create an instance of SchedulerFactory instance.&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;font-family: arial; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;    &lt;/b&gt;Scheduler: Scheduler interface is the main interface (API) to this functionality. It provides some simple operations like scheduling jobs, &lt;b&gt; &lt;/b&gt;unscheduling jobs, starting/stopping/pausing the scheduler.&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;font-family: arial; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;    &lt;/b&gt;start(): This method is used to starts the Scheduler&#39;s threads that fire Triggers. At the first time when we create the Scheduler it is in &quot;stand-by&quot; mode, and will not fire triggers. The scheduler can also be send back into stand-by mode by invoking the standby() method.&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;font-family: arial; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;    &lt;/b&gt;JobDetail(String name, String group, Class jobclass): The JobDetail object is created at the time the Job is added to scheduler. It contains various property settings like job name, group name and job class name. It can be used to store state information for a given instance of job class.&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;font-family: arial; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;    &lt;/b&gt;SimpleTrigger(String name, String group, Date startTime, Date endTime, int repeatCount, long repeatInterval): Trigger objects are used to firing the execution of jobs. When you want to schedule the job, instantiate the trigger and set the properties to provide the scheduling.&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;font-family: arial; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;    &lt;/b&gt;DEFAULT_GROUP: It is a constant, specified that &lt;b&gt; &lt;/b&gt;Job and &lt;b&gt; &lt;/b&gt;Trigger instances are belongs to which group..&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;font-family: arial; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;    &lt;/b&gt;REPEAT_INDEFINITELY: It is a constant used to indicate the &#39;repeat count&#39; of the trigger is indefinite.&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;font-family: arial; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;    &lt;/b&gt;scheduleJob(JobDetail &lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;jobDetail&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;, SimpleTrigger s&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;impleTrigger&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;): This method is used to add the JobDetail to the Scheduler, and associate the Trigger with it.&lt;/span&gt;&lt;/p&gt;OutPut:&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;file:///C:/Users/SRIHAR%7E1/AppData/Local/Temp/moz-screenshot-2.jpg&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;init:&lt;br /&gt;deps-jar:&lt;br /&gt;compile-single:&lt;br /&gt;run-single:&lt;br /&gt;log4j:WARN No appenders could be found for logger (org.quartz.simpl.SimpleThreadPool).&lt;br /&gt;log4j:WARN Please initialize the log4j system properly.&lt;br /&gt;Hello World -- Executed on : Mon Apr 14 22:52:25 IST 2008&lt;br /&gt;Hello World -- Executed on : Mon Apr 14 22:53:25 IST 2008&lt;br /&gt;Hello World -- Executed on : Mon Apr 14 22:54:25 IST 2008&lt;br /&gt;Hello World -- Executed on : Mon Apr 14 22:55:25 IST 2008</description><link>http://javawave.blogspot.com/2008/04/quartz-job-scheduler-part-ii-example.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-1572131741395265628</guid><pubDate>Mon, 07 Apr 2008 15:01:00 +0000</pubDate><atom:updated>2008-04-13T07:08:56.241-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Quartz</category><category domain="http://www.blogger.com/atom/ns#">scheduler</category><title>Quartz Job Scheduler -- Part 1 (Setting up development project in Netbeans 6.1 beta)</title><description>&lt;span style=&quot;font-weight: bold;&quot;&gt;Setting up development project in Netbeans 6.1 beta&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;Step 1 :&lt;/span&gt;&lt;/span&gt;&lt;span&gt;Run Netbeans IDE and create a New Java project opening the new project creation wizard like below. &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://1.bp.blogspot.com/_OIoG5Xsg62c/R_o5bWDT7MI/AAAAAAAAAq0/lRQlhv752cA/s1600-h/newProject.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;http://1.bp.blogspot.com/_OIoG5Xsg62c/R_o5bWDT7MI/AAAAAAAAAq0/lRQlhv752cA/s320/newProject.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5186521062809267394&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9u3NsDCWsaEBobAlqchQ_pa2-pR3ZgCmQxNZjqLy39ArhCoWJGBHClziMGu1ppoIhF5a-RVYSk-PbnrkuaXeTpBoE8Y0uB4Yg_f6MokuJlCcVExU7pr2AbscDtX8TKysFXu7BBWj5zks/s1600-h/newProject.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9u3NsDCWsaEBobAlqchQ_pa2-pR3ZgCmQxNZjqLy39ArhCoWJGBHClziMGu1ppoIhF5a-RVYSk-PbnrkuaXeTpBoE8Y0uB4Yg_f6MokuJlCcVExU7pr2AbscDtX8TKysFXu7BBWj5zks/s320/newProject.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5188729237857904338&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Step 2:  Click on the Next button and enter the project name. Here i am giving the name as &quot;MyQuartz&quot;.  Click on finish.  (see the below figure)&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWWaisGTj_sYZeRZugudYchawW9DXCgCzDaC5I0nioj40fyaz-44xHP79LXL4f0b1hB2Ig_MDq33nZBqwyO5q3jWqMkExXKjULTmKWWfeEJ-2fKU7WIN8gnM7Me3xzCl9dZFsiFpVGJmU/s1600-h/projName.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWWaisGTj_sYZeRZugudYchawW9DXCgCzDaC5I0nioj40fyaz-44xHP79LXL4f0b1hB2Ig_MDq33nZBqwyO5q3jWqMkExXKjULTmKWWfeEJ-2fKU7WIN8gnM7Me3xzCl9dZFsiFpVGJmU/s320/projName.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5188729955117442802&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Step 3: Download Quartz from the location --&gt; &lt;a href=&quot;http://www.opensymphony.com/quartz/download.action&quot;&gt;http://www.opensymphony.com/quartz/download.action&lt;/a&gt; . Once downloaded extract the archive to a location.&lt;br /&gt;Step 4: The below table explains the files inside the extracted archive.&lt;br /&gt;&lt;br /&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; height=&quot;124&quot; width=&quot;500&quot;&gt;   &lt;tbody&gt;&lt;tr&gt;     &lt;td height=&quot;19&quot; width=&quot;163&quot;&gt;&lt;b&gt;Files/Directory&lt;/b&gt;&lt;/td&gt;     &lt;td height=&quot;19&quot; width=&quot;325&quot;&gt;&lt;b&gt;Purpose&lt;/b&gt;&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height=&quot;76&quot; width=&quot;163&quot;&gt;quartz-all-&lt;ver&gt;.jar&lt;/ver&gt;&lt;/td&gt;     &lt;td height=&quot;76&quot; width=&quot;325&quot;&gt;  Quartz library includes the core Quartz components and all optional packages. If       you are using this library then no other quartz-*.jars       need to include.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height=&quot;17&quot; width=&quot;163&quot;&gt;quartz-&lt;ver&gt;.jar&lt;/ver&gt;&lt;/td&gt;     &lt;td height=&quot;17&quot; width=&quot;325&quot;&gt;core Quartz library.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height=&quot;17&quot; width=&quot;163&quot;&gt;quartz-jboss-&lt;ver&gt;.jar&lt;/ver&gt;&lt;/td&gt;     &lt;td height=&quot;17&quot; width=&quot;325&quot;&gt;  optional JBoss  Quartz extensions such as&lt;br /&gt;the Quartz startup MBean, QuartzService.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height=&quot;17&quot; width=&quot;163&quot;&gt;quartz-oracle-&lt;ver&gt;.jar&lt;/ver&gt;&lt;/td&gt;     &lt;td height=&quot;17&quot; width=&quot;325&quot;&gt;  optional Oracle specific Quartz extensions such as&lt;br /&gt;the OracleDelegate&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height=&quot;17&quot; width=&quot;163&quot;&gt;quartz-weblogic-&lt;ver&gt;.jar&lt;/ver&gt;&lt;/td&gt;     &lt;td height=&quot;17&quot; width=&quot;325&quot;&gt; optional WebLogic specific Quartz extensions such&lt;br /&gt;as the WebLogicDelegate&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height=&quot;17&quot; width=&quot;163&quot;&gt;build.xml&lt;/td&gt;     &lt;td height=&quot;17&quot; width=&quot;325&quot;&gt;               an &quot;ANT&quot; build file, for building Quartz.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height=&quot;17&quot; width=&quot;163&quot;&gt;docs&lt;/td&gt;     &lt;td height=&quot;17&quot; width=&quot;325&quot;&gt;         root directory of all       documentation&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height=&quot;17&quot; width=&quot;163&quot;&gt;docs/wikidocs&lt;/td&gt;     &lt;td height=&quot;17&quot; width=&quot;325&quot;&gt;               the main documentation for Quartz.  Start with       the &quot;index.html&quot;&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height=&quot;17&quot; width=&quot;163&quot;&gt;docs/dbTables&lt;/td&gt;     &lt;td height=&quot;17&quot; width=&quot;325&quot;&gt;    sql scripts for creating Quartz database tables in       a variety of different databases. &lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height=&quot;17&quot; width=&quot;163&quot;&gt;src/java/org/quartz&lt;/td&gt;     &lt;td height=&quot;17&quot; width=&quot;325&quot;&gt;     the main package of the Quartz project, containing the &#39;public&#39; (client-side) API for       the scheduler&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height=&quot;17&quot; width=&quot;163&quot;&gt;src/java/org/quartz/core&lt;/td&gt;     &lt;td height=&quot;17&quot; width=&quot;325&quot;&gt;    a package containing the &#39;private&#39; (server-side)&lt;br /&gt;               components of Quartz.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height=&quot;17&quot; width=&quot;163&quot;&gt;src/java/org/quartz/simpl&lt;/td&gt;     &lt;td height=&quot;17&quot; width=&quot;325&quot;&gt; this package contains simple implementations of&lt;br /&gt;               Quartz support modules (JobStores, ThreadPools,&lt;br /&gt;               Loggers, etc.) that have no dependencies on external (third-party) products.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height=&quot;17&quot; width=&quot;163&quot;&gt;src/java/org/quartz/impl&lt;/td&gt;     &lt;td height=&quot;17&quot; width=&quot;325&quot;&gt;  this package contains implementations of Quartz&lt;br /&gt;               support modules (JobStores, ThreadPools, Loggers, etc.) that may have dependencies on       external (third-party) products - but may be more robust.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height=&quot;17&quot; width=&quot;163&quot;&gt;src/java/org/quartz/utils&lt;/td&gt;     &lt;td height=&quot;17&quot; width=&quot;325&quot;&gt; this package contains some utility/helper components used through-out the main Quartz       components.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height=&quot;17&quot; width=&quot;163&quot;&gt;src/examples/org/quartz&lt;/td&gt;     &lt;td height=&quot;17&quot; width=&quot;325&quot;&gt;  this directory contains some examples       usage of Quartz. &lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height=&quot;17&quot; width=&quot;163&quot;&gt;webapp&lt;/td&gt;     &lt;td height=&quot;17&quot; width=&quot;325&quot;&gt;      this directory contains       a simple web-app for managing&lt;br /&gt;Quartz schedulers.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height=&quot;17&quot; width=&quot;163&quot;&gt;lib&lt;/td&gt;     &lt;td height=&quot;17&quot; width=&quot;325&quot;&gt;                     this directory contains       all third-party libraries that are needed to use all of the features of Quartz.&lt;/td&gt;   &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;Step 5: Open Add JAR/Folder wizard in netbeans like shown below.&lt;p&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwMy7QjkgwMZvHscjkF6-npvAjpxsdJsxQzLAeBD4T5WkXZfMNSwVS9ZewW031MdYoMwC-CFrkJveDq-IQXBylLZ0HEbew9RjRh8Ii05DwmSr9pbNSjMg-A67eSf6ilsuVi4uRjg0a0CQ/s1600-h/projectWin.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwMy7QjkgwMZvHscjkF6-npvAjpxsdJsxQzLAeBD4T5WkXZfMNSwVS9ZewW031MdYoMwC-CFrkJveDq-IQXBylLZ0HEbew9RjRh8Ii05DwmSr9pbNSjMg-A67eSf6ilsuVi4uRjg0a0CQ/s320/projectWin.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5188730487693387522&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;Step 6: Add &quot;quartz-all-1.6.0.jar&quot; and all other jars found inside &quot;lib&quot; folder.  See the below figure to see the added jars to the project.&lt;p&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqYSPIU6gZJSQj_x_8D7sImMQ3GOlIJfIAWBym_bx7liaqAajceCllfu1kbBG1H8o27qKutRLjSAipGthui2h18TVegd0jAIHDj0l6B-qh4jVT2LnwYvcftqeLrdxUlccjKYeh5ZsE5Ho/s1600-h/libs.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqYSPIU6gZJSQj_x_8D7sImMQ3GOlIJfIAWBym_bx7liaqAajceCllfu1kbBG1H8o27qKutRLjSAipGthui2h18TVegd0jAIHDj0l6B-qh4jVT2LnwYvcftqeLrdxUlccjKYeh5ZsE5Ho/s320/libs.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5188730912895149842&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://3.bp.blogspot.com/_OIoG5Xsg62c/R_pDv2DT7PI/AAAAAAAAArM/23gfh_BqeeQ/s1600-h/libs.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;http://3.bp.blogspot.com/_OIoG5Xsg62c/R_pDv2DT7PI/AAAAAAAAArM/23gfh_BqeeQ/s320/libs.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5186532410112863474&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Step 7: Now the Development Environment is ready.&lt;br /&gt;&lt;/p&gt;</description><link>http://javawave.blogspot.com/2008/04/quartz-job-scheduler-part-1-setting-up.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_OIoG5Xsg62c/R_o5bWDT7MI/AAAAAAAAAq0/lRQlhv752cA/s72-c/newProject.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-976088838887988332</guid><pubDate>Thu, 20 Mar 2008 23:40:00 +0000</pubDate><atom:updated>2008-03-20T16:42:04.200-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">jars</category><category domain="http://www.blogger.com/atom/ns#">Java</category><title>Collection of Jars in One place</title><description>From the below URL we can find the collection of Java related jars in one place.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.java2s.com/Code/Jar/CatalogJar.htm&quot;&gt;http://www.java2s.com/Code/Jar/CatalogJar.htm&lt;/a&gt;</description><link>http://javawave.blogspot.com/2008/03/collection-of-jars-in-one-place.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-9092410587661093780</guid><pubDate>Thu, 20 Mar 2008 23:16:00 +0000</pubDate><atom:updated>2008-03-20T16:20:42.603-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">IDE</category><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">NetBeans</category><title>Highlights of NetBeans 6.1</title><description>Highlights of NetBeans 6.1 include:&lt;br /&gt;&lt;br /&gt;* JavaScript support such as semantic highlighting, code completion, type analysis, quick fixes, semantic checks and refactoring;&lt;br /&gt;&lt;br /&gt;* Performance enhancements including faster startup and code completion;&lt;br /&gt;&lt;br /&gt;* Spring framework support with features such as configuration file support, code completion and hyperlinks to speed navigation;&lt;br /&gt;&lt;br /&gt;* New MySQL support in the Database Explorer to make it easier to create, launch and view MySQL databases;&lt;br /&gt;&lt;br /&gt;* Significant enhancements to the Ruby/JRuby support, including a new Ruby platform manager, support for the latest version of Rails and new hints and quick fixes in the editor;&lt;br /&gt;&lt;br /&gt;* Beta support for the ClearCase version control system - made available as a plugin from the Update Center.&lt;br /&gt;&lt;br /&gt;download from --&gt; &lt;a href=&quot;http://dlc.sun.com.edgesuite.net/netbeans/6.1/beta/ &quot;&gt;http://dlc.sun.com.edgesuite.net/netbeans/6.1/beta/ &lt;/a&gt;</description><link>http://javawave.blogspot.com/2008/03/highlights-of-netbeans-61.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-6964764605900025115</guid><pubDate>Mon, 03 Dec 2007 08:35:00 +0000</pubDate><atom:updated>2007-12-03T01:09:03.058-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">spring</category><title>Spring - Part I</title><description>Here is the simple example to start up with spring,&lt;br /&gt;&lt;br /&gt;To write a simple spring application we need one interface, one implementation of that interface and a test client to test the implementation. Apart form that we also need a configuration XML file.&lt;br /&gt;&lt;br /&gt; One interface --&gt; Hello.java &lt;br /&gt; One implementation --&gt; HelloImpl.java&lt;br /&gt; One Test Client --&gt; HelloClient.java&lt;br /&gt; One Spring XML File --&gt; Hello.xml (Should be in the classpath).&lt;br /&gt;&lt;br /&gt;Now let us see the interface Hello.java.&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;package com.javawave.spring.cli;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * @author dhanago&lt;br /&gt; */&lt;br /&gt;public interface Hello&lt;br /&gt;{&lt;br /&gt;   /**&lt;br /&gt;    * This method will return the salutation for the name passed as input&lt;br /&gt;    * param to it.&lt;br /&gt;    * &lt;br /&gt;    * @param name&lt;br /&gt;    * @return&lt;br /&gt;    */&lt;br /&gt;   public String sayHello( String name );&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The above interface has only one method to say hello. This method has to be implemented in the implementation class &quot;HelloImpl.java&quot;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;package com.javawave.spring.cli;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * @author dhanago&lt;br /&gt; */&lt;br /&gt;public class HelloImpl implements Hello&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;   private String greet;&lt;br /&gt;&lt;br /&gt;   /**&lt;br /&gt;    * zero-arg constructor&lt;br /&gt;    */&lt;br /&gt;   public HelloImpl()&lt;br /&gt;   {&lt;br /&gt;      &lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   /**&lt;br /&gt;    * @param greet&lt;br /&gt;    */&lt;br /&gt;   public HelloImpl( String greet )&lt;br /&gt;   {&lt;br /&gt;      this.greet = greet;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   /*&lt;br /&gt;    * (non-Javadoc)&lt;br /&gt;    * &lt;br /&gt;    * @see com.javawave.spring.cli.Hello#sayHello(java.lang.String)&lt;br /&gt;    */&lt;br /&gt;   public String sayHello( String name )&lt;br /&gt;   {&lt;br /&gt;&lt;br /&gt;      return this.greet + name;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   /**&lt;br /&gt;    * @param greet the greet to set&lt;br /&gt;    */&lt;br /&gt;   public void setGreet( String greet )&lt;br /&gt;   {&lt;br /&gt;      this.greet = greet;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;The Impl class has a property called greet. This also has a setter method &quot;setGreet&quot; to set the value for this property. &lt;br /&gt;&lt;br /&gt;Now let us see the spring xml. This XML file will be used for creating the objects in spring framework. This XML is also called wiring xml. Through this XML we will set the greet property of the HelloImpl class. &lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Hello.XML&lt;/span&gt;&lt;br /&gt;~~~~~~~~~&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE beans PUBLIC&lt;br /&gt;&quot;-//SPRING//DTD BEAN//EN&quot;&lt;br /&gt;&quot;http://www.springframework.org/dtd/spring-beans.dtd&quot;&amp;gt;&lt;br /&gt;  &amp;lt;beans&amp;gt;&lt;br /&gt;   &amp;lt;bean id=&quot;hello&quot;&lt;br /&gt;         class=&quot;com.javawave.spring.cli.HelloImpl&quot;&amp;gt;&lt;br /&gt;     &amp;lt;property name=&quot;greet&quot;&amp;gt;&lt;br /&gt;       &amp;lt;value&amp;gt;Good Morning!...&amp;lt;/value&amp;gt;&lt;br /&gt;     &amp;lt;/property&amp;gt;&lt;br /&gt;   &amp;lt;/bean&amp;gt;&lt;br /&gt;&amp;lt;/beans&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Here in the XML you can see the tag called bean which will map to the bean what you are using in the application.  It has an attribute called &quot;id&quot; and a attribute called  &quot;class&quot;. The &quot;class&quot; attribute maps to the HelloImpl.java in our case. The property tag inside the bean tag maps to the property inside the bean class. Here in our case it is the &quot;greet&quot; property. The value for the property is given in the value element inside the property element. This is the value passed to the bean&#39;s property &quot;greet&quot; . This is how spring does the dependency injection (DI). Here what you are doing is injecting dependency through setter method. This is also called Setter Injection.&lt;br /&gt;&lt;br /&gt;Now we will see the client application &quot;HelloClient.java&quot; to test the &quot;HelloImpl.java&quot;.&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;/**&lt;br /&gt; * &lt;br /&gt; */&lt;br /&gt;package com.javawave.spring.cli;&lt;br /&gt;&lt;br /&gt;import org.springframework.beans.factory.BeanFactory;&lt;br /&gt;import org.springframework.beans.factory.xml.XmlBeanFactory;&lt;br /&gt;import org.springframework.core.io.ClassPathResource;&lt;br /&gt;import org.springframework.core.io.Resource;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * @author dhanago&lt;br /&gt; */&lt;br /&gt;public class HelloClient&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;   /**&lt;br /&gt;    * @param args&lt;br /&gt;    */&lt;br /&gt;   public static void main( String[] args )&lt;br /&gt;   {&lt;br /&gt;      try&lt;br /&gt;      {&lt;br /&gt;         System.out.println( &quot;Inside main of HelloClient..&quot; );&lt;br /&gt;         Resource resource = new ClassPathResource(&lt;br /&gt;               &quot;com/javawave/spring/cli/Hello.xml&quot; );&lt;br /&gt;         BeanFactory factory = new XmlBeanFactory( resource );&lt;br /&gt;         Hello hello = (Hello) factory.getBean( &quot;hello&quot; );&lt;br /&gt;         String result = hello.sayHello( &quot;Man&quot; );&lt;br /&gt;         System.out.println( result );&lt;br /&gt;      }&lt;br /&gt;      catch (Exception e)&lt;br /&gt;      {&lt;br /&gt;         System.out.println( &quot;Exception/Error:&quot; + e.toString() );&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;This client application uses ClassPathResource to load the resource. In our case Hello.xml and it creates the factory via XmlBeanFactory. factory class has getBean method which will return a object. Here we get Hello object. So from that we can call sayHello method as shown in the above code and get the result.&lt;br /&gt;&lt;br /&gt;The Jars used for this application is:&lt;br /&gt;  spring.jar&lt;br /&gt;  commons-logging.jar&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;The Output is shown below&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;Inside main of HelloClient..&lt;br /&gt;Good Morning!...Man&lt;br /&gt;Dec 3, 2007 1:59:01 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions&lt;br /&gt;INFO: Loading XML bean definitions from class path resource [com/javawave/spring/cli/Hello.xml]</description><link>http://javawave.blogspot.com/2007/12/spring-part-i.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-6566860832168955380</guid><pubDate>Fri, 30 Nov 2007 09:03:00 +0000</pubDate><atom:updated>2007-11-30T01:21:50.065-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><title>Comparing two Value Objects in Java</title><description>In Java comparing two value object is not straight forward.  Here we will see how we can compare two value objects in Java.&lt;br /&gt;&lt;br /&gt;For that first we will create a value object called &quot;MyValueObject&quot;. This value object contains two properties. 1) firstName 2) lastName. Both the properties are of type string.&lt;br /&gt;&lt;br /&gt;In the same class we also have a overridden method which does the comparison for us. This method &quot;public boolean equals(Object obj)&quot; takes the properties and compare them individually. if the properties values are all equal then it returns true or it will return false. By doing this our test class will just call the equals method on the object to make sure if the objects are equal or not.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Code is listed below&lt;/span&gt;.&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;/*&lt;br /&gt; */&lt;br /&gt;package com.blogspot.javawave;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; *&lt;br /&gt; * @author dhanago&lt;br /&gt; */&lt;br /&gt;public class MyValueObject&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    private String firstName;&lt;br /&gt;    private String lastName;&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * This constructor is used to set the two properties values in the class.&lt;br /&gt;     *&lt;br /&gt;     * @param firstName&lt;br /&gt;     * @param lastName&lt;br /&gt;     */&lt;br /&gt;    public MyValueObject(String firstName,&lt;br /&gt;                          String lastName)&lt;br /&gt;    {&lt;br /&gt;        this.firstName = firstName;&lt;br /&gt;        this.lastName = lastName;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    public boolean equals(Object obj)&lt;br /&gt;    {&lt;br /&gt;        boolean isEqual = false;&lt;br /&gt;        if (this.getClass() == obj.getClass())&lt;br /&gt;        {&lt;br /&gt;            MyValueObject myValueObject = (MyValueObject) obj;&lt;br /&gt;            if ((myValueObject.firstName).equals(this.firstName) &amp;amp;&amp;amp;&lt;br /&gt;                    (myValueObject.lastName).equals(this.lastName))&lt;br /&gt;            {&lt;br /&gt;                isEqual = true;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        return isEqual;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Test class is given below:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;/*&lt;br /&gt; */&lt;br /&gt;package com.blogspot.javawave;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; *This class is used to test compare the value object.&lt;br /&gt; *&lt;br /&gt; * @author dhanago&lt;br /&gt; */&lt;br /&gt;public class TestCompareValueObject&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * This is the main method used to test compare the value object.&lt;br /&gt;     * @param arg&lt;br /&gt;     */&lt;br /&gt;    public static void main(String[] arg)&lt;br /&gt;    {&lt;br /&gt;        MyValueObject obj1 = new MyValueObject(&quot;Muthu&quot;, &quot;Kumar&quot;);&lt;br /&gt;        MyValueObject obj2 = new MyValueObject(&quot;Muthu&quot;, &quot;Kumar&quot;);&lt;br /&gt;       &lt;br /&gt;        if (obj1.equals(obj2))&lt;br /&gt;        {&lt;br /&gt;            System.out.println(&quot;Both the objects are equal&quot;);&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            System.out.println(&quot;Both the objects are not equal&quot;);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;This one of the way we can easily compare the value objects in Java</description><link>http://javawave.blogspot.com/2007/11/comparing-two-value-objects-in-java.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-3228240150491346279</guid><pubDate>Tue, 13 Nov 2007 16:49:00 +0000</pubDate><atom:updated>2007-11-13T08:51:03.471-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SOA</category><category domain="http://www.blogger.com/atom/ns#">Web Services</category><title>SOA principles</title><description>&lt;h2&gt;&lt;span class=&quot;mw-headline&quot;&gt;SOA principles&lt;/span&gt;&lt;/h2&gt; &lt;p&gt;The following &lt;b&gt;guiding principles&lt;/b&gt; define the ground rules for development, maintenance, and usage of the SOA&lt;sup id=&quot;_ref-6&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Service-oriented_architecture#_note-6&quot; title=&quot;&quot;&gt;[8]&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;Reuse, &lt;a href=&quot;http://en.wikipedia.org/wiki/Granularity&quot; title=&quot;Granularity&quot;&gt;granularity&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Modularity_%28programming%29&quot; title=&quot;Modularity (programming)&quot;&gt;modularity&lt;/a&gt;, composability, componentization, and &lt;a href=&quot;http://en.wikipedia.org/wiki/Interoperability&quot; title=&quot;Interoperability&quot;&gt;interoperability&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Compliance to standards (both common and industry-specific)&lt;/li&gt;&lt;li&gt;Services identification and categorization, provisioning and delivery, and monitoring and tracking&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;The following &lt;b&gt;specific architectural principles&lt;/b&gt; for design and service definition focus on specific themes that influence the intrinsic behaviour of a system and the style of its design:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;b&gt;Service &lt;a href=&quot;http://en.wikipedia.org/wiki/Encapsulation&quot; title=&quot;Encapsulation&quot;&gt;Encapsulation&lt;/a&gt;&lt;/b&gt; - A lot of existing web-services are consolidated to be used under the SOA Architecture. Many a times, such services have not been planned to be under SOA.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Service &lt;a href=&quot;http://en.wikipedia.org/wiki/Loose_coupling&quot; title=&quot;Loose coupling&quot;&gt;Loose coupling&lt;/a&gt;&lt;/b&gt; - Services maintain a relationship that minimizes dependencies and only requires that they maintain an awareness of each other&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Service-oriented_architecture#Service_contract&quot; title=&quot;&quot;&gt;Service contract&lt;/a&gt;&lt;/b&gt; - Services adhere to a communications agreement, as defined collectively by one or more service description documents&lt;/li&gt;&lt;li&gt;&lt;b&gt;Service abstraction&lt;/b&gt; - Beyond what is described in the service contract, services hide logic from the outside world&lt;/li&gt;&lt;li&gt;&lt;b&gt;Service reusability&lt;/b&gt; - Logic is divided into services with the intention of promoting reuse&lt;/li&gt;&lt;li&gt;&lt;b&gt;Service composability&lt;/b&gt; - Collections of services can be coordinated and assembled to form composite services&lt;/li&gt;&lt;li&gt;&lt;b&gt;Service autonomy&lt;/b&gt; – Services have control over the logic they encapsulate&lt;/li&gt;&lt;li&gt;&lt;b&gt;Service optimization&lt;/b&gt; – All else equal, high-quality services are generally considered preferable to low-quality ones&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Service_discovery&quot; title=&quot;Service discovery&quot;&gt;Service discoverability&lt;/a&gt;&lt;/b&gt; – Services are designed to be outwardly descriptive so that they can be found and assessed via available discovery mechanisms&lt;sup id=&quot;_ref-7&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Service-oriented_architecture#_note-7&quot; title=&quot;&quot;&gt;[9]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;In addition, the following factors should also be taken into account when defining a SOA implementation:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;SOA Reference Architecture covers the SOA Reference Architecture, which provides a worked design of an enterprise-wide SOA implementation with detailed architecture diagrams, component descriptions, detailed requirements, design patterns, opinions about standards, patterns on regulation compliance, standards templates etc.&lt;sup id=&quot;_ref-8&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Service-oriented_architecture#_note-8&quot; title=&quot;&quot;&gt;[10]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;&lt;li&gt;Life cycle management &lt;a href=&quot;http://www.soablueprint.com/whitepapers/SOAPGPart3.pdf&quot; class=&quot;external text&quot; title=&quot;http://www.soablueprint.com/whitepapers/SOAPGPart3.pdf&quot; rel=&quot;nofollow&quot;&gt;SOA Practitioners Guide Part 3: Introduction to Services Lifecycle&lt;/a&gt; introduces the Services Lifecycle and provides a detailed process for services management though the service lifecycle, from inception through to retirement or repurposing of the services. It also contains an appendix that includes organization and governance best practices, templates, comments on key SOA standards, and recommended links for more information.&lt;/li&gt;&lt;li&gt;Efficient use of system resources&lt;/li&gt;&lt;li&gt;Service maturity and performance&lt;/li&gt;&lt;li&gt;EAI Enterprise Application Integration&lt;/li&gt;&lt;/ul&gt;</description><link>http://javawave.blogspot.com/2007/11/soa-principles.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-1440051681495165783</guid><pubDate>Fri, 02 Nov 2007 09:41:00 +0000</pubDate><atom:updated>2007-11-02T02:42:42.859-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Web Services</category><category domain="http://www.blogger.com/atom/ns#">xml</category><title>What is WSDL?</title><description>&lt;div class=&quot;sidebar&quot;&gt;&lt;p&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;                 WSDL stands for Web Services Description Language. A &lt;span style=&quot;font-style: italic;&quot;&gt;WSDL &lt;/span&gt;file is an &lt;span style=&quot;font-style: italic;&quot;&gt;XML &lt;/span&gt;document that describes a Web                  service. It specifies the location of the service and the operations (or methods) the service exposes.                 For more information about WSDL, refer to the                  &lt;a xlink=&quot;http://www.w3.org/1999/xlink&quot; href=&quot;http://www.w3.org/TR/wsdl&quot; target=&quot;_top&quot;&gt;WSDL specification&lt;/a&gt;, or read the                  &lt;a xlink=&quot;http://www.w3.org/1999/xlink&quot; href=&quot;http://www.w3schools.com/wsdl/&quot; target=&quot;_top&quot;&gt;WSDL tutorial&lt;/a&gt;&lt;/span&gt;             &lt;/p&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2007/11/what-is-wsdl.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-4913515863435915095</guid><pubDate>Sat, 13 Oct 2007 16:22:00 +0000</pubDate><atom:updated>2007-10-13T09:25:57.940-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">xml</category><title>Java Excel API</title><description>&lt;p&gt;&lt;b&gt;Where to get the &lt;/b&gt;&lt;b&gt;jexcelapi&lt;/b&gt;&lt;b&gt;?&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;Get the API download form --&amp;gt; &lt;a title=&quot;http://jexcelapi.sourceforge.net/&quot; target=&quot;_blank&quot; href=&quot;http://jexcelapi.sourceforge.net/&quot; id=&quot;igco&quot;&gt;http://jexcelapi.sourceforge.net/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What is jexcelapi ?&lt;/b&gt;&lt;br /&gt;&lt;p&gt;A Java API to read, write, and modify Excel spreadsheets.&lt;/p&gt;&lt;p&gt;Now java developers can read Excel spreadsheets, modify them with a convenient and&lt;br /&gt;&lt;/p&gt;&lt;p&gt;simple API, and   write the changes to any output stream (e.g. disk, HTTP, database, or&lt;br /&gt;&lt;/p&gt;&lt;p&gt;any socket).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Because it is Java, the API can be    invoked from within a servlet, thus giving access to&lt;/p&gt;&lt;p&gt; Excel spreadsheets   over internet and intranet web applications.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;b&gt;Features of jexcelapi&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; height=&quot;218&quot; width=&quot;573&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;Reads data from Excel 95, 97, 2000, &lt;span style=&quot;color:red;&quot;&gt;XP, and 2003&lt;/span&gt; workbooks   &lt;br /&gt;Reads and writes formulas (Excel 97 and later only)  &lt;br /&gt;Generates spreadsheets in Excel 2000 format Supports font, number and date formatting Supports shading, bordering, and coloring of cells Modifies existing worksheets Is internationalized, enabling processing in almost any locale, country, language, or character encoding (formulas are currently only supported in English, French, Spanish, and German, but more can be added if translated) Supports copying of charts &lt;span style=&quot;color:red;&quot;&gt;Supports insertion and copying of images into spreadsheets&lt;/span&gt;   Supports logging with Jakarta Commons Logging, log4j, JDK 1.4 Logger, etc   ...and much more.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;      Technical notes ==&amp;gt; &lt;a title=&quot;http://www.andykhan.com/jexcelapi/technotes.html&quot; target=&quot;_blank&quot; href=&quot;http://www.andykhan.com/jexcelapi/technotes.html&quot; id=&quot;gm7t&quot;&gt;http://www.andykhan.com/jexcelapi/technotes.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; &lt;p&gt;JExcelApi JavaDoc ==&amp;gt; &lt;a title=&quot;http://jexcelapi.sourceforge.net/resources/javadocs/index.html&quot; target=&quot;_blank&quot; href=&quot;http://jexcelapi.sourceforge.net/resources/javadocs/index.html&quot; id=&quot;onja&quot;&gt;http://jexcelapi.sourceforge.net/resources/javadocs/index.html&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;b&gt;Pre-Requirements&lt;/b&gt;:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Should be knowing basic concepts of Java.&lt;/li&gt;&lt;li&gt;Should know how to set class path to use third party Api&#39;s.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Now we will see how to read a spread sheet using this API&lt;/b&gt;:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;First of all we will create a spread sheet like the one below and store it in our local folder.&lt;/p&gt;&lt;p&gt;I am saving this file in &quot;D:testmyFile.xls&quot;&lt;br /&gt;&lt;/p&gt;&lt;img src=&quot;post-edit.g?blogID=3404003298352104506&amp;amp;postID=8242921327018719891&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;&lt;img src=&quot;http://docs.google.com/File?id=dv968zb_75dfkqw2d4&quot; /&gt;&lt;br /&gt;&lt;div id=&quot;j-za&quot; style=&quot;padding: 1em 0pt; text-align: left;&quot;&gt;To read the spread sheet content using jxl Api, first we have to create an object called&lt;br /&gt;Workbook. Once you create the Workbook then you will get access to individual sheets.&lt;br /&gt;Note that these sheets are Zero indexed.&lt;br /&gt;So you have to use some thing like workbook.getSheet(0);&lt;br /&gt;&lt;br /&gt;Once you get the sheet then you can easily get the cells and their content as string.&lt;br /&gt;If you want it is also possible to get the data with out changing the type as it is.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;See the sample code below (&lt;/u&gt;&lt;i&gt;&lt;u&gt;SpreadsheetReader.java&lt;/u&gt;&lt;/i&gt;&lt;u&gt;)&lt;/u&gt;.&lt;br /&gt;&lt;br /&gt;package com.jxl.dhanago;&lt;br /&gt;&lt;br /&gt;import java.io.File;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;import jxl.Cell;&lt;br /&gt;import jxl.Sheet;&lt;br /&gt;import jxl.Workbook;&lt;br /&gt;import jxl.read.biff.BiffException;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* This Java program is used to read the spread sheet and print it in&lt;br /&gt;* console output.&lt;br /&gt;*&lt;br /&gt;* @author dhanago&lt;br /&gt;*/&lt;br /&gt;public class SpreadsheetReader&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * This method is used to read a spread sheet and print it in console.&lt;br /&gt;   *&lt;br /&gt;   * @param xlsPath&lt;br /&gt;   */&lt;br /&gt;  public void readSpreadSheet( String xlsPath )&lt;br /&gt;  {&lt;br /&gt;     try&lt;br /&gt;     {&lt;br /&gt;        /*&lt;br /&gt;         * To read the spread sheet , first we have to create a workbook&lt;br /&gt;         * object like one shown below.&lt;br /&gt;         */&lt;br /&gt;        Workbook workbook = Workbook.getWorkbook( new File( xlsPath ) );&lt;br /&gt;        /*&lt;br /&gt;         * then get the sheet index 0. Note the index starts with 0.&lt;br /&gt;         */&lt;br /&gt;        Sheet sheet = workbook.getSheet( 0 );&lt;br /&gt;        /*&lt;br /&gt;         * get the cell form the sheet object like below.&lt;br /&gt;         */&lt;br /&gt;        Cell cell00 = sheet.getCell( 0, 0 );&lt;br /&gt;        Cell cell01 = sheet.getCell( 0, 1 );&lt;br /&gt;        Cell cell02 = sheet.getCell( 0, 2 );&lt;br /&gt;&lt;br /&gt;        /*&lt;br /&gt;         * now we will display the cell values as string in console output.&lt;br /&gt;         */&lt;br /&gt;        System.out.println( &quot;Cell00 value: &quot; + cell00.getContents() );&lt;br /&gt;        System.out.println( &quot;Cell01 value: &quot; + cell01.getContents() );&lt;br /&gt;        System.out.println( &quot;Cell02 value: &quot; + cell02.getContents() );&lt;br /&gt;         // free up memory&lt;br /&gt;        workbook.close();&lt;br /&gt;     }&lt;br /&gt;     catch (BiffException e)&lt;br /&gt;     {&lt;br /&gt;        e.printStackTrace();&lt;br /&gt;     }&lt;br /&gt;     catch (IOException e)&lt;br /&gt;     {&lt;br /&gt;        e.printStackTrace();&lt;br /&gt;     }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * This is the main executable method used to test the spread sheet&lt;br /&gt;   * reader.&lt;br /&gt;   *&lt;br /&gt;   * @param args&lt;br /&gt;   */&lt;br /&gt;  public static void main( String[] args )&lt;br /&gt;  {&lt;br /&gt;     SpreadsheetReader readSpreadsheet = new SpreadsheetReader();&lt;br /&gt;     String xlsPath = &quot;D:\test\myFile.xls&quot;;&lt;br /&gt;     readSpreadsheet.readSpreadSheet( xlsPath );&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;u&gt;OutPut for the above code:&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Cell00 value: Name&lt;br /&gt;Cell01 value: Muthukumar Dhanagopal&lt;br /&gt;Cell02 value: Krish&lt;br /&gt;&lt;br /&gt;The above code displays the cell values as string. How to get the same&lt;br /&gt;data type and display them with out converting them to string. Is that&lt;br /&gt;possible using this API?&lt;br /&gt;&lt;br /&gt;Yes, it is possible.&lt;br /&gt;&lt;i&gt;&lt;u&gt;Here is the code which does the same for you&lt;/u&gt;&lt;/i&gt;.&lt;br /&gt;It checks the cell type for LABEL,  NUMBER or DATE and then gets the value from&lt;br /&gt;the cell type cast the value to that particular data type and displays it on the console.&lt;br /&gt;&lt;br /&gt;package com.jxl.dhanago;&lt;br /&gt;&lt;br /&gt;import java.io.File;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;import jxl.Cell;&lt;br /&gt;import jxl.CellType;&lt;br /&gt;import jxl.DateCell;&lt;br /&gt;import jxl.LabelCell;&lt;br /&gt;import jxl.NumberCell;&lt;br /&gt;import jxl.Sheet;&lt;br /&gt;import jxl.Workbook;&lt;br /&gt;import jxl.read.biff.BiffException;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* This java program is used to get and display the xls data according to&lt;br /&gt;* the type.&lt;br /&gt;*&lt;br /&gt;* @author dhanago&lt;br /&gt;*/&lt;br /&gt;public class ReadXLWithExactDataType&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * This method is used to display the xls data with exact type.&lt;br /&gt;   *&lt;br /&gt;   * @param xlsPath&lt;br /&gt;   */&lt;br /&gt;  public void readDataWithType( String xlsPath )&lt;br /&gt;  {&lt;br /&gt;     try&lt;br /&gt;     {&lt;br /&gt;        /*&lt;br /&gt;         * To read the spread sheet , first we have to create a workbook&lt;br /&gt;         * object like one shown below.&lt;br /&gt;         */&lt;br /&gt;        Workbook workbook = Workbook.getWorkbook( new File( xlsPath ) );&lt;br /&gt;        /*&lt;br /&gt;         * then get the sheet index 0. Note the index starts with 0.&lt;br /&gt;         */&lt;br /&gt;        Sheet sheet = workbook.getSheet( 0 );&lt;br /&gt;        /*&lt;br /&gt;         * get the cell form the sheet object like below.&lt;br /&gt;         */&lt;br /&gt;        Cell cell00 = sheet.getCell( 0, 0 );&lt;br /&gt;&lt;br /&gt;        if (cell00.getType() == CellType.LABEL)&lt;br /&gt;        {&lt;br /&gt;           System.out.println( &quot;Type LABEL&quot; );&lt;br /&gt;           LabelCell labelCell = (LabelCell) cell00;&lt;br /&gt;           System.out.println( &quot;Label Cell: &quot; + labelCell.getString() );&lt;br /&gt;        }&lt;br /&gt;        else if (cell00.getType() == CellType.NUMBER)&lt;br /&gt;        {&lt;br /&gt;           System.out.println( &quot;Type NUMBER&quot; );&lt;br /&gt;           NumberCell numberCell = (NumberCell) cell00;&lt;br /&gt;           System.out.println( &quot;Number Cell: &quot; + numberCell.getValue() );&lt;br /&gt;        }&lt;br /&gt;        else if (cell00.getType() == CellType.DATE)&lt;br /&gt;        {&lt;br /&gt;           System.out.println( &quot;Type DATE&quot; );&lt;br /&gt;           DateCell dateCell = (DateCell) cell00;&lt;br /&gt;           System.out.println( &quot;Date Cell: &quot; + dateCell.getDate() );&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;           System.out.println( &quot;Type not supported.&quot; );&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        /*&lt;br /&gt;         * now we will display the cell values as string in console output.&lt;br /&gt;         */&lt;br /&gt;        System.out.println( &quot;Cell00 value: &quot; + cell00.getContents() );&lt;br /&gt;        // free up memory&lt;br /&gt;        workbook.close();&lt;br /&gt;     }&lt;br /&gt;     catch (BiffException e)&lt;br /&gt;     {&lt;br /&gt;        e.printStackTrace();&lt;br /&gt;     }&lt;br /&gt;     catch (IOException e)&lt;br /&gt;     {&lt;br /&gt;        e.printStackTrace();&lt;br /&gt;     }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * This is the main executable method used to test the spread sheet&lt;br /&gt;   * reader.&lt;br /&gt;   *&lt;br /&gt;   * @param args&lt;br /&gt;   */&lt;br /&gt;  public static void main( String[] args )&lt;br /&gt;  {&lt;br /&gt;     ReadXLWithExactDataType readXL = new ReadXLWithExactDataType();&lt;br /&gt;     String xlsPath = &quot;D:\test\myFile.xls&quot;;&lt;br /&gt;     readXL.readDataWithType( xlsPath );&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;u&gt;The Output for the above code is&lt;/u&gt;&lt;/i&gt;:&lt;br /&gt;Type LABEL&lt;br /&gt;Label Cell: Name&lt;br /&gt;Cell00 value: Name&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2007/10/java-excel-api.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-6228534997984855908</guid><pubDate>Wed, 10 Oct 2007 09:49:00 +0000</pubDate><atom:updated>2007-10-10T02:52:34.209-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Artificial Intelligence</category><category domain="http://www.blogger.com/atom/ns#">Drools</category><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">JBoss</category><category domain="http://www.blogger.com/atom/ns#">Rule Engine</category><title>Rule Engine - Drools</title><description>What is a Rule Engine?&lt;br /&gt;&lt;p&gt;Artificial Intelligence (A.I.) is a very broad research area that focuses on  &quot;Making computers think like people&quot; and includes disciplines such as Neural  Networks, Genetic Algorithms, Decision Trees, Frame Systems and Expert Systems.  Knowledge representation is the area of A.I. concerned with how knowledge is  represented and manipulated. Expert Systems use Knowledge representation to  facilitate the codification of knowledge into a knowledge base which can be used  for reasoning - i.e. we can process data with this knowledge base to infer  conclusions. Expert Systems are also known as Knowledge-based Systems and  Knowledge-based Expert Systems and are considered &#39;applied artificial  intelligence&#39;. The process of developing with an Expert System is Knowledge  Engineering. EMYCIN was one of the first &quot;shells&quot; for an Expert System, which  was created from the MYCIN medical diagnosis Expert System. Where-as early  Expert Systems had their logic hard coded, &quot;shells&quot; separated the logic from the  system, providing an easy to use environment for user input. Drools is a Rule  Engine that uses the Rule Based approached to implement an Expert System and is  more correctly classified as a Production Rule System.&lt;/p&gt; &lt;p&gt;The term &quot;Production Rule&quot; originates from formal grammar - where it is  described as &quot;an abstract structure that describes a formal language precisely,  i.e., a set of rules that mathematically delineates a (usually infinite) set of  finite-length strings over a (usually finite) alphabet&quot; (&lt;a class=&quot;ulink&quot; href=&quot;http://en.wikipedia.org/wiki/Formal_grammar&quot; target=&quot;_top&quot;&gt;wikipedia&lt;/a&gt;).&lt;/p&gt;For more information visit the following URL&lt;br /&gt;&lt;a href=&quot;https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/html/ch02.html&quot;&gt;https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/html/ch02.html &lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>http://javawave.blogspot.com/2007/10/rule-engine-drools.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-8447843447988659005</guid><pubDate>Wed, 10 Oct 2007 07:20:00 +0000</pubDate><atom:updated>2007-10-10T00:21:45.572-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Eclipse</category><category domain="http://www.blogger.com/atom/ns#">IDE</category><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">JBoss</category><title>JBoss server in Eclipse</title><description>&lt;span style=&quot;font-weight: bold;&quot;&gt;Defining JBoss server in Eclipse&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;Step 1 : Open Eclipse WTP all in one pack in a new work space.&lt;br /&gt;&lt;br /&gt;Step 2 : Change the perspective to J2EE Perspective if it is not currently in J2EE Perspective.&lt;br /&gt;&lt;br /&gt;Step 3 : Once the Perspective is changed to J2EE, you can see a tab called Servers in the bottom right panel along with Problems, Tasks, Properties.&lt;br /&gt;&lt;br /&gt;Step 4 : If the Servers tab is not found. Go to Eclipse menu : Windows &gt; Show view and click on Servers, so that Server tab will be displayed.&lt;br /&gt;&lt;br /&gt;Step 5 : Go to Servers tab window and right click the mouse. You will get a pop up menu called &quot;New&quot;.&lt;br /&gt;&lt;br /&gt;Step 6 : Clicking on the New menu you will get one more pop up called &quot;Server&quot;. Click on it.&lt;br /&gt;&lt;br /&gt;Step 7 : Now you will get Define New Server Wizard.&lt;br /&gt;&lt;br /&gt;Step 8 : In the wizard there are options to define many servers. One among them is JBoss. Click on JBoss and Expand the tree.&lt;br /&gt;&lt;br /&gt;Step 9 : Select JBoss v 4.0 and click next.&lt;br /&gt;&lt;br /&gt;Step 10 : Now give the JDK directory and JBoss home directory. Click Next.&lt;br /&gt;&lt;br /&gt;Step 11 : Now the wizard will show you the default Address, port, etc., Leave it as it is and click on Next.&lt;br /&gt;&lt;br /&gt;Step 12 : Click on finish.&lt;br /&gt;&lt;br /&gt;Step 13 : Now you can see the JBoss server listed in the Servers window and the status is Sopped.&lt;br /&gt;&lt;br /&gt;Step 14 : JBoss server is now defined in Eclipse now and its ready to use from with in Eclipse IDE.</description><link>http://javawave.blogspot.com/2007/10/jboss-server-in-eclipse.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-5418282162355230520</guid><pubDate>Mon, 08 Oct 2007 12:04:00 +0000</pubDate><atom:updated>2007-10-08T22:04:57.816-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">xml</category><title>DOM parsing technique</title><description>&lt;span style=&quot;color: rgb(0, 0, 255);font-family:Arial;font-size:85%;&quot;  &gt; &lt;/span&gt;&lt;div style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;;font-family:Arial;font-size:85%;&quot;  &gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;This class follows the DOM parsing technique and does the  following.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; 1.Parse the demoxml.xml file.&lt;br /&gt;2.Search for the xml node  by the name &quot;parent1&quot; from the xml.&lt;br /&gt;3.Create a new child node by the name  &quot;newChild&quot;&lt;br /&gt;4.Create a text(&quot;new child of the parent1&quot;) to the &quot;newChild&quot;  node&lt;br /&gt;5.Append the &quot;newChild&quot; node to &quot;parent1&quot; node.&lt;br /&gt;6.Save the  changes (transform) to the xml.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Sample Code&lt;/span&gt;: (&lt;/span&gt;&lt;span style=&quot;;font-family:Arial;font-size:85%;&quot;  &gt;DOMParser.java)&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;;font-family:Arial;font-size:85%;&quot;  &gt; &lt;/span&gt;&lt;/div&gt;package com.dom.dhanago;&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt; * This class follows the DOM parsing technique and does the following.&lt;br /&gt; * 1.Parse the demoxml.xml file. 2.Search for the xml node by the name&lt;br /&gt; * &quot;parent1&quot; from the xml. 3.Create a new child node by the name &quot;newChild&quot;&lt;br /&gt; * 4.Create a text(&quot;new child of the parent1&quot;) to the &quot;newChild&quot; node&lt;br /&gt; * 5.Append the &quot;newChild&quot; node to &quot;parent1&quot; node. 6.Save the changes&lt;br /&gt; * (transform) to the xml.&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;import java.io.File;&lt;br /&gt;&lt;br /&gt;import javax.xml.parsers.DocumentBuilder;&lt;br /&gt;import javax.xml.parsers.DocumentBuilderFactory;&lt;br /&gt;import javax.xml.transform.Result;&lt;br /&gt;import javax.xml.transform.Source;&lt;br /&gt;import javax.xml.transform.Transformer;&lt;br /&gt;import javax.xml.transform.TransformerFactory;&lt;br /&gt;import javax.xml.transform.dom.DOMSource;&lt;br /&gt;import javax.xml.transform.stream.StreamResult;&lt;br /&gt;&lt;br /&gt;import org.w3c.dom.Document;&lt;br /&gt;import org.w3c.dom.Element;&lt;br /&gt;import org.w3c.dom.NodeList;&lt;br /&gt;&lt;br /&gt;public class DOMParser&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;   public static void main( String[] args )&lt;br /&gt;   {&lt;br /&gt;      try&lt;br /&gt;      {&lt;br /&gt;         DocumentBuilderFactory factory = DocumentBuilderFactory&lt;br /&gt;               .newInstance();&lt;br /&gt;         DocumentBuilder builder = factory.newDocumentBuilder();&lt;br /&gt;         Document document;&lt;br /&gt;         document = builder.parse( new File( &quot;C:\\demoxml.xml&quot; ) );&lt;br /&gt;         /*&lt;br /&gt;          * You can pass either xml file or string.To fetch the root element&lt;br /&gt;          * of the xml document.&lt;br /&gt;          */&lt;br /&gt;         Element rootEle = document.getDocumentElement();&lt;br /&gt;         /*&lt;br /&gt;          * To fetch all the child nodes of the root element.&lt;br /&gt;          */&lt;br /&gt;         NodeList childNodes = rootEle.getChildNodes();&lt;br /&gt;         /*&lt;br /&gt;          * To search an element from the whole document.&lt;br /&gt;          */&lt;br /&gt;         NodeList parentNode = document.getElementsByTagName( &quot;parent1&quot; );&lt;br /&gt;         /*&lt;br /&gt;          * To create a new child element by the name &quot;newChild&quot;.&lt;br /&gt;          */&lt;br /&gt;         Element newChild = document.createElement( &quot;newChild&quot; );&lt;br /&gt;         /*&lt;br /&gt;          * Adding text data to &quot;newChild&quot;.&lt;br /&gt;          */&lt;br /&gt;         newChild.appendChild( document&lt;br /&gt;               .createTextNode( &quot;new Child of the parent1 node&quot; ) );&lt;br /&gt;&lt;br /&gt;         /*&lt;br /&gt;          * To append the &quot;newChild&quot; ,created above.&lt;br /&gt;          */&lt;br /&gt;         parentNode.item( 0 ).appendChild( newChild );&lt;br /&gt;&lt;br /&gt;         TransformerFactory tranFactory = TransformerFactory.newInstance();&lt;br /&gt;         Transformer aTransformer = tranFactory.newTransformer();&lt;br /&gt;&lt;br /&gt;         /*&lt;br /&gt;          * Preparing the source which is the document created above.&lt;br /&gt;          */&lt;br /&gt;         Source srcDocument = new DOMSource( document );&lt;br /&gt;         /*&lt;br /&gt;          * Destination will be same different xml.&lt;br /&gt;          */&lt;br /&gt;         Result destxml = new StreamResult( new File( &quot;C:\\demoxml.xml&quot; ) );&lt;br /&gt;         /*&lt;br /&gt;          * Transforming document to destination xml.&lt;br /&gt;          */&lt;br /&gt;         aTransformer.transform( srcDocument, destxml );&lt;br /&gt;         System.out.println( &quot;Successfully transformed&quot; );&lt;br /&gt;      }&lt;br /&gt;      catch (Exception e)&lt;br /&gt;      {&lt;br /&gt;         System.out.println( &quot;exec &quot; + e );&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;}</description><link>http://javawave.blogspot.com/2007/10/dom-parsing-technique.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-2857628350230392862</guid><pubDate>Fri, 05 Oct 2007 09:54:00 +0000</pubDate><atom:updated>2007-10-05T03:39:04.922-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><category domain="http://www.blogger.com/atom/ns#">xml</category><title>Code to convert from Xml-String to Document and Document to String</title><description>package ora.in;&lt;br /&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.io.StringReader;&lt;br /&gt;import java.io.StringWriter;&lt;br /&gt;&lt;br /&gt;import javax.xml.parsers.DocumentBuilder;&lt;br /&gt;import javax.xml.parsers.DocumentBuilderFactory;&lt;br /&gt;import javax.xml.parsers.FactoryConfigurationError;&lt;br /&gt;import javax.xml.parsers.ParserConfigurationException;&lt;br /&gt;import javax.xml.transform.Result;&lt;br /&gt;import javax.xml.transform.Source;&lt;br /&gt;import javax.xml.transform.Transformer;&lt;br /&gt;import javax.xml.transform.TransformerFactory;&lt;br /&gt;import javax.xml.transform.dom.DOMSource;&lt;br /&gt;import javax.xml.transform.stream.StreamResult;&lt;br /&gt;&lt;br /&gt;import org.w3c.dom.Document;&lt;br /&gt;import org.xml.sax.InputSource;&lt;br /&gt;import org.xml.sax.SAXException;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Code to convert from Xml-String to Document and Document to String.&lt;br /&gt;*&lt;br /&gt;* @author Muthu&lt;br /&gt;*/&lt;br /&gt;public class S2DandD2S&lt;br /&gt;{&lt;br /&gt;  public static Document loadXmlFileToDocument( String strXml,&lt;br /&gt;        boolean ignoreComments )&lt;br /&gt;  {&lt;br /&gt;     Document docRet = null;&lt;br /&gt;     try&lt;br /&gt;     {&lt;br /&gt;        DocumentBuilderFactory factory = DocumentBuilderFactory&lt;br /&gt;              .newInstance();&lt;br /&gt;        factory.setIgnoringComments( ignoreComments );&lt;br /&gt;        DocumentBuilder docBuilder = factory.newDocumentBuilder();&lt;br /&gt;        docRet = docBuilder.parse( new InputSource( new StringReader(&lt;br /&gt;              strXml ) ) );&lt;br /&gt;     }&lt;br /&gt;     catch (SAXException e)&lt;br /&gt;     {&lt;br /&gt;        System.out.println( &quot;SAXException&quot; );&lt;br /&gt;     }&lt;br /&gt;     catch (IOException e)&lt;br /&gt;     {&lt;br /&gt;        System.out.println( &quot;IOException&quot; );&lt;br /&gt;     }&lt;br /&gt;     catch (ParserConfigurationException e)&lt;br /&gt;     {&lt;br /&gt;        System.out.println( &quot;ParserConfigurationException&quot; );&lt;br /&gt;     }&lt;br /&gt;     catch (FactoryConfigurationError e)&lt;br /&gt;     {&lt;br /&gt;        System.out.println( &quot;FactoryConfigurationError&quot; );&lt;br /&gt;     }&lt;br /&gt;     return docRet;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * @param args&lt;br /&gt;   */&lt;br /&gt;  public static void main( String[] args )&lt;br /&gt;  {&lt;br /&gt;     try&lt;br /&gt;     {&lt;br /&gt;        String xml = &quot;Some exception file as string&lt;javawave xsi=&quot;\&amp;quot;http://www.w3.org/2001/&amp;quot;&quot;&gt;&lt;/javawave&gt;&quot;;&lt;br /&gt;&lt;br /&gt;        Document document = loadXmlFileToDocument( xml, false );&lt;br /&gt;        TransformerFactory tranFactory = TransformerFactory.newInstance();&lt;br /&gt;        Transformer aTransformer = tranFactory.newTransformer();&lt;br /&gt;&lt;br /&gt;        Source srcDocument = new DOMSource( document );&lt;br /&gt;&lt;br /&gt;        // Preparing the source which is the document created above.&lt;br /&gt;        StringWriter writer = new StringWriter();&lt;br /&gt;        Result destxml = new StreamResult( writer );&lt;br /&gt;&lt;br /&gt;        // Transformingdocument to destination xml.&lt;br /&gt;        aTransformer.transform( srcDocument, destxml );&lt;br /&gt;&lt;br /&gt;        System.out.println( writer.toString() );&lt;br /&gt;        System.out.println( &quot;Successfully transformed&quot; );&lt;br /&gt;     }&lt;br /&gt;     catch (Exception e)&lt;br /&gt;     {&lt;br /&gt;        System.out.println( &quot;exec &quot; + e );&lt;br /&gt;     }&lt;br /&gt;  }&lt;br /&gt;}</description><link>http://javawave.blogspot.com/2007/10/code-to-convert-from-xml-string-to.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total>0</thr:total></item></channel></rss>