tag:blogger.com,1999:blog-62051720721861926982024-02-07T14:33:38.361-08:00Manoj: on the Open Source worldManoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.comBlogger36125tag:blogger.com,1999:blog-6205172072186192698.post-73543139159120123662010-11-14T04:07:00.000-08:002010-11-14T04:10:54.207-08:00Facebook Vs Google, its going to be intresting..<span class="Apple-style-span" ><span class="Apple-style-span" style="font-size: 24px;"><b><span class="Apple-style-span" style="color: rgb(64, 64, 64); font-weight: normal; font-size: 13px; line-height: 18px; ">Social networking site Facebook may announce its e-mail service as early as Monday, if online buzz is to be believed. <a href="http://economictimes.indiatimes.com/infotech/internet/Facebook-may-announce-e-mail-service-Monday/articleshow/6924187.cms">Read more</a></span></b></span></span><div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com0tag:blogger.com,1999:blog-6205172072186192698.post-38191953573522580812009-09-21T07:46:00.000-07:002009-09-21T08:19:01.972-07:00Loading Message Resources From DatabaseInstead of loading message resource from properties file, here is the code to how to use database as a message resource bundle in struts applcation.<div><br /></div><div><span class="Apple-style-span" style=" background-color: rgb(192, 192, 192); font-family:'Courier New';"><b><span class="Apple-style-span" style="font-size:medium;">DBPropertyMessageResources.java</span></b></span></div><div><span class="Apple-style-span" style="font-family:'Courier New';"><span class="Apple-style-span" style="font-size:medium;"><b><br /></b></span></span></div><div><span class="Apple-style-span" style="font-family:'Courier New';"><span class="Apple-style-span" style="font-size:medium;"><b><p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><b><span style="Courier New"; font-family:";font-size:10.0pt;color:#7F0055;">public</span></b><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"> </span><b><span style="Courier New"; font-family:";font-size:10.0pt;color:#7F0055;">class</span></b><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"> <span style="background:silver;mso-highlight:silver">DBPropertyMessageResources</span> </span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">extends</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;"> MessageResources {</span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"font-family:";font-size:10.0pt;"><o:p> </o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-tab-count:1"> </span></span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">public</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;"> DBPropertyMessageResources(MessageResourcesFactory factory, String config,</span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">boolean</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;"> returnNull) {</span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span class="Apple-style-span" style="font-weight: normal; "><b></b></span></p><b><p class="MsoNormal" style="display: inline !important; "><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-tab-count:2"> </span></span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">super</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;">(factory, config,returnNull);</span></p></b></b></span><b><p></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span class="Apple-style-span" style="font-weight: normal; "><b></b></span></p><b><p class="MsoNormal" style="display: inline !important; "><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-tab-count:2"> </span></span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">this</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;">.</span><span style="Courier New";font-family:";font-size:10.0pt;color:#0000C0;">factory</span><span style="Courier New";font-family:";font-size:10.0pt;color:black;">=factory;</span></p></b><p></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-tab-count:2"> </span></span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">this</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;">.</span><span style="Courier New";font-family:";font-size:10.0pt;color:#0000C0;">config</span><span style="Courier New";font-family:";font-size:10.0pt;color:black;">=config;</span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-tab-count:2"> </span></span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">this</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;">.</span><span style="Courier New";font-family:";font-size:10.0pt;color:#0000C0;">returnNull</span><span style="Courier New";font-family:";font-size:10.0pt;color:black;">=</span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">false</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;">;</span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span class="Apple-style-span" style="font-weight: normal; "><b></b></span></p><b><p class="MsoNormal" style="display: inline !important; "><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-tab-count:1"> </span>}</span></p></b><p></p><p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"></span></span></p><span class="Apple-style-span" style="font-size:100%;"><p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-spacerun:yes"> </span></span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">public</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;"> String getMessage(Locale locale, String key) {</span><span style=" Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-spacerun:yes"> </span><span style="mso-tab-count: 1"> </span>String result = DBPropertyMessageService.<i>getMessage</i>(locale, key,</span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-spacerun:yes"> </span><span style="mso-tab-count: 2"> </span></span><span style="Courier New"; font-family:";font-size:10.0pt;color:#0000C0;">returnNull</span><span style="Courier New"; font-family:";font-size:10.0pt;color:black;">);</span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-spacerun:yes"> </span></span><span style="Courier New";font-family:";font-size:10.0pt;color:#3F7F5F;">// we need to flush the cache of the super class MessageResource as</span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:#3F7F5F;">//we want to have real <span style="mso-tab-count:1"> </span><span style="mso-spacerun:yes"> </span>dynamic data here (no caches</span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-spacerun:yes"> </span></span><span style="Courier New";font-family:";font-size:10.0pt;color:#3F7F5F;">//except the one in DBPropertyMessageService)</span><span style=" Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-spacerun:yes"> </span></span><span style="Courier New";font-family:";font-size:10.0pt;color:#0000C0;">formats</span><span style="Courier New";font-family:";font-size:10.0pt;color:black;">.clear();</span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-spacerun:yes"> </span></span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">return</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;"> result; </span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;">}</span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p><p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none">}</p><p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><br /></p><p class="MsoNormal"><span style=" color: black; background-image: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background- background-position: initial initial; font-family:'Courier New';color:silver;"><span class="Apple-style-span" style="font-size:medium;">DBPropertyMessageResourcesFactory.java</span></span><span style="font-family:"Courier New";mso-fareast-Times New Roman"; mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language: AR-SAfont-family:";font-size:10.0pt;color:black;"></span></p><p class="MsoNormal"><span class="Apple-style-span" style="font-size:medium;"><br /></span></p><p class="MsoNormal"><span class="Apple-style-span" style="font-size:medium;"></span></p><p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><b><span style="Courier New"; font-family:";font-size:10.0pt;color:#7F0055;">public</span></b><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"> </span><b><span style="Courier New"; font-family:";font-size:10.0pt;color:#7F0055;">class</span></b><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"> <span style="background:silver;mso-highlight:silver">DBPropertyMessageResourcesFactory</span> </span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">extends</span></b><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;">MessageResourcesFactory {</span><span style=" Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-tab-count:1"> </span><span style="mso-spacerun:yes"> </span></span><b><span style=" Courier New";font-family:";font-size:10.0pt;color:#7F0055;">public</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;"> MessageResources createResources(String config) {</span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-tab-count:1"> </span><span style="mso-spacerun:yes"> </span></span><b><span style=" Courier New";font-family:";font-size:10.0pt;color:#7F0055;">return</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;"> </span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">new</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;"> DBPropertyMessageResources(</span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">this</span></b><span style=" Courier New";font-family:";font-size:10.0pt;color:black;">, config,<span style="mso-tab-count: 1"> </span></span><b><span style="Courier New"; font-family:";font-size:10.0pt;color:#7F0055;">this</span></b><span style="Courier New"; font-family:";font-size:10.0pt;color:black;">.</span><span style="Courier New"; font-family:";font-size:10.0pt;color:#0000C0;">returnNull</span><span style="Courier New"; font-family:";font-size:10.0pt;color:black;">);</span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-tab-count:1"> </span><span style="mso-spacerun:yes"> </span>}</span><span style=" Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span class="Apple-style-span" style="font-weight: normal; "><b></b></span></p><b><p class="MsoNormal" style="display: inline !important; "><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"></span></span></p><span class="Apple-style-span" style="font-size:100%;"><p class="MsoNormal" style="display: inline !important; "><span class="Apple-style-span" style="font-size:medium;"></span></p><p class="MsoNormal" style="display: inline !important; "><span style="Courier New"; font-family:";font-size:10.0pt;color:black;">}</span></p></span></b><b><span class="Apple-style-span" style="font-size:100%;"><p></p></span></b><b><span class="Apple-style-span" style="font-size:100%;"></span><p></p></b><p></p><p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"><br /></span></span></p><p class="MsoNormal"><span style=" color: black; background-image: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background- background-position: initial initial; font-family:'Courier New';color:silver;">DBPropertyMessageService.java</span><span style="font-family:"Courier New";mso-fareast-Times New Roman"; mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language: AR-SAfont-family:";font-size:10.0pt;color:black;"></span></p><p class="MsoNormal"><span class="Apple-style-span" style="background-color: rgb(192, 192, 192);"><br /></span></p><p class="MsoNormal"></p><p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><b><span style="Courier New"; font-family:";font-size:10.0pt;color:#7F0055;">public</span></b><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"> </span><b><span style="Courier New"; font-family:";font-size:10.0pt;color:#7F0055;">class</span></b><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"> <span style="background:silver;mso-highlight:silver">DBPropertyMessageService</span> {</span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"font-family:";font-size:10.0pt;"><o:p> </o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-tab-count:1"> </span></span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">public</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;"> </span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">static</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;"> String getMessage(Locale locale, String key, </span><b><span style=" Courier New";font-family:";font-size:10.0pt;color:#7F0055;">boolean</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;"> returnNull) <span class="Apple-tab-span" style="white-space:pre"> </span>{</span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span class="Apple-style-span" style="font-weight: normal; "><b></b></span></p><b><p class="MsoNormal" style="display: inline !important; "><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"></span></span></p><span class="Apple-style-span" style="font-size:100%;"><p class="MsoNormal" style="display: inline !important; "><span class="Apple-style-span" style="font-size:medium;"></span></p><p class="MsoNormal" style="display: inline !important; "></p><p class="MsoNormal" style="display: inline !important; "><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-tab-count:2"> </span>key=</span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">null</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;">;</span></p><p></p></span></b><b><span class="Apple-style-span" style="font-size:100%;"><p></p></span></b><b><span class="Apple-style-span" style="font-size:100%;"></span><p></p></b><p></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-tab-count:2"> </span>returnNull=</span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">true</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;">;</span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-tab-count:2"> </span>locale=</span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">null</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;">;</span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p><p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span class="Apple-style-span" style="font-size: -webkit-xxx-large;"><span class="Apple-style-span" style="font-weight: normal; font-size: 16px; "><b><span class="Apple-style-span" style="font-size:100%;"></span></b></span></span></p><b><span class="Apple-style-span" style="font-size:100%;"><p class="MsoNormal"><span style="font-family:";font-size:10.0pt;color:#3F7F5F;">// do the jdbc coding to get the value from the database using the key </span></p></span></b><p></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span class="Apple-style-span" style="font-weight: normal; "><b></b></span></p><b><p class="MsoNormal" style="display: inline !important; "><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"></span></span></p><span class="Apple-style-span" style="font-size:100%;"><p class="MsoNormal" style="display: inline !important; "><span class="Apple-style-span" style="font-size:medium;"></span></p><p class="MsoNormal" style="display: inline !important; "></p><p class="MsoNormal" style="display: inline !important; "><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-tab-count:2"> </span></span><b><span style="Courier New";font-family:";font-size:10.0pt;color:#7F0055;">return</span></b><span style="Courier New";font-family:";font-size:10.0pt;color:black;"> </span><span style="Courier New";font-family:";font-size:10.0pt;color:#2A00FF;">"sparkle software"</span><span style="Courier New"; font-family:";font-size:10.0pt;color:black;">;</span></p><p></p></span></b><b><span class="Apple-style-span" style="font-size:100%;"><p></p></span></b><b><span class="Apple-style-span" style="font-size:100%;"></span><p></p></b><p></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-tab-count:1"> </span>}</span><span style="Courier New"font-family:";font-size:10.0pt;"><o:p></o:p></span></p> <p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span style="Courier New"font-family:";font-size:10.0pt;"><o:p> <span class="Apple-style-span" style="font-weight: normal; font-size:medium;"><b><span class="Apple-style-span" style="font-size:100%;"></span></b></span></o:p></span></p><b><span class="Apple-style-span" style="font-size:100%;"><p class="MsoNormal" style="display: inline !important; "><span style="Courier New"; font-family:";font-size:10.0pt;color:black;"><span style="mso-tab-count:1"> </span>}</span></p><p></p></span></b><b><span class="Apple-style-span" style="font-size:100%;"><p></p></span></b><b><span class="Apple-style-span" style="font-size:100%;"></span><p></p></b><p></p><p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"><br /></span></span></p><p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"><span class="Apple-style-span" style="font-weight: normal; font-size:medium;"><b></b></span></span></span></p><span class="Apple-style-span" style="font-size:100%;"><b><p class="MsoNormal"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span" style=" ;font-size:13px;"></span></span></p><span class="Apple-style-span" style="font-size:100%;"><p class="MsoNormal"><span class="Apple-style-span" style=" ;font-size:medium;"></span></p><p class="MsoNormal"><span style=" color: black; background-image: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background- background-position: initial initial; font-family:'Courier New';color:silver;">struts-config.xml</span></p><p class="MsoNormal"><span class="Apple-style-span" style="background-color: rgb(192, 192, 192);"></span></p><p class="MsoNormal" style="mso-pagination:none;mso-layout-grid-align:none; text-autospace:none"><span class="Apple-style-span" style="font-weight: normal; "><b></b></span></p><b><p class="MsoNormal" style="display: inline !important; "><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"></span></span></p><span class="Apple-style-span" style="font-size:100%;"><p class="MsoNormal" style="display: inline !important; "><span class="Apple-style-span" style="font-size:medium;"></span></p><p class="MsoNormal" style="display: inline !important; "></p><p class="MsoNormal" style="display: inline !important; "><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"><span class="Apple-style-span" style="font-weight: normal; font-size:medium;"><b><span class="Apple-style-span" style="font-size:100%;"></span></b></span></span></span></p><span class="Apple-style-span" style="font-size:100%;"><b><span class="Apple-style-span" style="font-size:100%;"><p class="MsoNormal" style="display: inline !important; "><span class="Apple-style-span" style="background-color: rgb(192, 192, 192);"></span></p><p class="MsoNormal" style="display: inline !important; "><span style="Courier New"; background:blue;mso-highlight:bluefont-family:";font-size:10.0pt;color:black;"><span class="Apple-style-span" style="font-weight: normal; font-size:medium;"><b></b></span></span></p><b><p class="MsoNormal" style="display: inline !important; "><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"></span></span></p><span class="Apple-style-span" style="font-size:100%;"><p class="MsoNormal" style="display: inline !important; "><span class="Apple-style-span" style="font-size:medium;"></span></p><p class="MsoNormal" style="display: inline !important; "></p><p class="MsoNormal" style="display: inline !important; "><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span" style="font-size:13px;"><span class="Apple-style-span" style="font-weight: normal; font-size:medium;"><b><span class="Apple-style-span" style="font-size:100%;"></span></b></span></span></span></p><span class="Apple-style-span" style="font-size:100%;"><b><span class="Apple-style-span" style="font-size:100%;"><p class="MsoNormal" style="display: inline !important; "><span class="Apple-style-span" style="background-color: rgb(192, 192, 192);"></span></p><p class="MsoNormal" style="display: inline !important; "><span style="Courier New"; background:blue;mso-highlight:bluefont-family:";font-size:10.0pt;color:teal;"><</span><span style="Courier New";background: blue;mso-highlight:bluefont-family:";font-size:10.0pt;color:#3F7F7F;">message-resources </span><span style=" Courier New";background:blue;mso-highlight:bluefont-family:";font-size:10.0pt;color:#7F007F;">factory</span><span style="Courier New";background:blue; mso-highlight:bluefont-family:";font-size:10.0pt;color:black;">=</span><span style="Courier New"; background:blue;mso-highlight:bluefont-family:";font-size:10.0pt;color:#2A00FF;">"com.sparkle.resources.DBPropertyMessageResourcesFactory" </span><span style="Courier New"; background:blue;mso-highlight:bluefont-family:";font-size:10.0pt;color:#7F007F;">parameter</span><span style="Courier New";background:blue;mso-highlight: bluefont-family:";font-size:10.0pt;color:black;">=</span><span style="Courier New"; background:blue;mso-highlight:bluefont-family:";font-size:10.0pt;color:#2A00FF;">"param1"</span><span style="Courier New";background:blue; mso-highlight:bluefont-family:";font-size:10.0pt;color:teal;">/></span></p></span></b></span></span></b><p></p></span></b></span></span></b><b><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span" style="font-size:100%;"><b><span class="Apple-style-span" style="font-size:100%;"><p></p></span></b></span></span></b><b><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span" style="font-size:100%;"></span><p></p><p></p><p></p></span><p></p></b><p></p><p></p></span></b><b><span class="Apple-style-span" style="font-size:100%;"><p></p></span></b><b><span class="Apple-style-span" style="font-size:100%;"></span><p></p></b></span><p></p><p></p><p></p></span><p></p></b></span></div><div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com1tag:blogger.com,1999:blog-6205172072186192698.post-6948481242345720802009-09-06T22:21:00.000-07:002009-09-07T00:11:27.310-07:00Search Engine for API SearchWhen I was doing research this morning, I came to know that there is a search engine for API search called <a href="http://start.gotapi.com/">gotAPI.com</a>. They have got all kinds of api search like java, database, ajax, frameworks etc. And now, they have launched new beta version of gotAPI.com <a href="http://beta.gotapi.com/">http://beta.gotapi.com/</a> this have got lot of new features and included more api's. It will be helpful for developers, so I thought of writing this post.<div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com1tag:blogger.com,1999:blog-6205172072186192698.post-5048406539559763852009-09-04T04:14:00.000-07:002009-09-04T04:20:49.731-07:00Java Magic NumberA numerical identifier for the class file. It should always be <span style="font-weight: bold;">CAFEBABE</span>, in hex, stored in the first 4 bytes of the class file. The easiest way to corrupt a class file’s magic number is to upload it to your website with FTP failing to turn on the binary option<br /><br />Sometimes during the transmission of files, the connection may be aborted, or may be scrambled, causing class loading to fail. Sometimes when copying files over to a web server, they may become garbled or a disk error might occur. For this reason, special care is taken by the JVM and the class loader, to verify that classes are intact. One of the precautions is that every class definition contains at the beginning the magic number, a sequence of four bytes that identify a file as a Java class definition file.<div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com1tag:blogger.com,1999:blog-6205172072186192698.post-21972363198872710662009-09-04T03:33:00.000-07:002009-09-04T03:40:40.901-07:00Yahoo memeYahoo launches a microblogging platform which looks like twitter. Now in English version of <a href="http://meme.yahoo.com">Yahoo meme</a><div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com0tag:blogger.com,1999:blog-6205172072186192698.post-65634618062754771762009-08-10T23:58:00.000-07:002009-08-11T00:18:25.550-07:00Google Caffeine - New version of Google Search?Google has just unveiled a “secret project” of “<a href="http://googlewebmastercentral.blogspot.com/2009/08/help-test-some-next-generation.html">next-generation architecture for Google’s web search</a>“.<br /><br /><b>What's New</b><br /><p>The categories for the new search engine on are as follows: speed, accuracy, temporal relevancy, and index size. Here’s how we define those:<br /><span id="more-138268"></span></p> <blockquote> <p><strong>Speed:</strong> How fast can the new search engine load results?</p> <p><strong>Accuracy:</strong> Which set of results is more accurate to the search term?</p> <p><strong>Temporal Relevancy:</strong> Is one version of search better at capturing breaking news? </p> <p><strong>Index Size:</strong> Is it really more comprehensive than the last version of Google? </p> </blockquote><br />Please visit the web developer preview of Google's new infrastructure at <a href="http://www2.sandbox.google.com/">http://www2.sandbox.google.com/</a> and try searches there.<div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com0tag:blogger.com,1999:blog-6205172072186192698.post-50831094865083526052009-08-04T01:49:00.000-07:002009-08-04T09:43:17.432-07:00Servlets vs Portlets<ul> <li> Portlets are not accessible by a URL. Portlets are intended to be part of a page, as opposed to being independent pages.</li> </ul> <ul> <li> Browsers and web clients interact with portlets through the portal server. Portlets can neither set HTTP headers, nor be aware of the client URL.</li> </ul> <ul> <li> The portal server provides a customized subset of the request object to a portlet.</li> </ul> <ul> <li> Portlets only contribute a fragment of the HTML page that is eventually presented to the browser, and not the whole page. A portal server aggregates these fragments from various portlets to create a final page.<br /> </li> </ul> <ul> <li> Portlets come with certain modes and window states that make them function independently of the whole page behavior.<br /> </li> </ul> <ul> <li> Portlets have access to some specialized functionality that allows storage of states and preferences across requests and sessions.<br /> </li> </ul><div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com0tag:blogger.com,1999:blog-6205172072186192698.post-19731202267918260712009-08-03T02:06:00.000-07:002009-08-03T02:13:35.135-07:00Eclipse based LDAP Browser and Directory Client<a href="http://directory.apache.org/studio/">Apache Directory Studio</a> is a completely directory tooling platform intended to be used with any LDAP server however it is particularly designed for use with Apache Directory Sever.<br /><br /><b>Features<br /></b> <ul> <li>LDAP Browser</li> </ul>The LDAP Browser has been designed to work with almost any LDAP server available. It not only permits to read and display the tree of your LDAP Server but also allows you to modify it by creating, editing or removing entries. <ul> <li>LDIF Editor</li> </ul> The LDIF Editor is a tool for editing LDIF files. It provides syntax highlighting and content assistance. <ul> <li>Schema Editor</li> </ul> The Schema Editor has been designed to edit the schema files in the OpenLDAP format. It allows you to edit easily attribute types and object classes for Apache Directory Server and OpenLDAP. <ul> <li>Embeded ApacheDS</li> </ul> Apache Directory Studio bundles the latest version of the LDAPV3 certified Apache DS. Creating and launching a new LDAP server now takes less than 10 seconds! <ul> <li>ApacheDS Configuration</li> </ul> The Apache DS Configuration Editor can be used to edit the server configuration ('server.xml' file) of an Apache Directory Server installation. <ul> <li>ACI Editor</li> </ul> The ACI Editor allows you to define, for an entry or a set of entries, graphically or manually (in souce code mode), an ACI (Access Control Information) item specification for Apache Directory Server. <ul> <li>Internationalization</li> </ul> Apache Directory Studio is now internationalized in English, French and German. We're also open for volunteers who want to add another language support. <ul> <li>Multi-platform & in eclipse</li> </ul> Based on Eclipse, Apache Directory Studio is a multi-plaform application that runs on Mac OS X, Linux and Windows, and also as plugins inside Eclipse itself.<div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com1tag:blogger.com,1999:blog-6205172072186192698.post-59506612340559810442009-07-31T03:24:00.000-07:002009-07-31T03:27:16.980-07:00New Features and Enhancements in JDK 7<ul> <li>The <code>java.nio.file</code> package and its related package, <code>java.nio.file.attribute</code>, provide comprehensive support for file I/O and for accessing the file system. See <a href="http://java.sun.com/docs/books/tutorial/essential/io/file.html"> File I/O (featuring NIO 2.0)</a> in the <a href="http://java.sun.com/docs/books/tutorial">Java Tutorials</a> </li> <p> </p> <li>Networking </li> <p> </p> <ul> <li> <p>Sockets Direct Protocol (SDP) is a wire protocol developed to support stream connections over InfiniBand fabric. For more information, see <a href="http://java.sun.com/docs/books/tutorial/sdp/sockets/"> Understanding the Sockets Direct Protocol</a> a trail in the <a href="http://java.sun.com/docs/books/tutorial">Java Tutorials</a>. </p> </li> <li><a href="http://java.sun.com/javase/7/docs/technotes/guides/net/ClassLoader.html">Closing a URL Classloader </a></li> <p> </p> </ul> <li>Java HotSpot Virtual Machine<br> <p> </p> </li> <ul> <li><a href="http://java.sun.com/javase/7/docs/technotes/guides/vm/compressedOops.html">Compressed Oops</a> in the Hotspot JVM </li> <p> </p> <li> <p><a href="http://java.sun.com/javase/7/docs/technotes/guides/vm/performance-enhancements-7.html">Java HotSpot Virtual Machine Performance Enhancements</a> </p> </li> </ul> <ul> <li> <p><a href="http://java.sun.com/javase/7/docs/technotes/guides/vm/mulitple-language-support.html">Java Virtual Machine Suppport for Non-Java Languages</a> </p> </li> </ul> <p> </p> <ul> <li><a href="http://java.sun.com/javase/7/docs/technotes/guides/vm/G1.html">Garbage-First Collector</a> </li> </ul> <p> </p> <li> <p><a href="http://java.sun.com/javase/7/webnotes/updates/encodings.html">Supported Encodings</a> </p> </li> <p> </p> <li> <p><a href="http://java.sun.com/javase/7/webnotes/updates/locales.html">Supported Locales</a> </p> </li> <p> </p> <li> <p><a href="http://java.sun.com/webapps/bugreport">Submitting a Bug Report and Available Support Options</a> </p> </li> <li> <p><a href="http://java.sun.com/javase/7/docs/legal/SMICopyright.html">Copyright and License Terms for Documentation</a></p> </li> </ul> <div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com2tag:blogger.com,1999:blog-6205172072186192698.post-68520378493046013142009-07-30T07:33:00.000-07:002009-07-30T07:36:16.465-07:00Tips for Using Tomcat in Production<ol> <li><strong>If you're running on a 1.5+ JVM, add the following to your <code>JAVA_OPTS</code> in catalina.sh</strong> (or <code>catalina.bat</code> for Windows): <div class="syntax_hilite"><span class="langName"><br> </span> <div id="code-1"> <div class="code"> <ol> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/j2ee/heapdumps </div> </li> </ol> </div> </div> </div> <p>Then use a tool such as <a href="http://www.yourkit.com">YourKit</a> to analyze the heapdump file. </p> </li> <li>Straight from the <a href="http://tomcat.apache.org/tomcat-5.5-doc/jasper-howto.html">Tomcat documentation on Jasper 2</a>...<br> <blockquote> <p>When using Jasper 2 in a production Tomcat server you should consider making the following changes from the default configuration.<br> <strong>development</strong> - To disable on access checks for JSP pages compilation set this to <code>false</code>.<br> <strong>genStringAsCharArray</strong> - To generate slightly more efficient char arrays, set this to <code>true</code>.<br> <strong>modificationTestInterval</strong> - If development has to be set to <code>true</code> for any reason (such as dynamic generation of JSPs), setting this to a high value will improve performance a lot.<br> <strong>trimSpaces</strong> - To remove useless bytes from the response, set this to <code>true</code>.</p> </blockquote> </li> <li>Use <a href="http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html">Tomcat's clustering/session replication</a> capability to minimize application user impact during maintenance periods.</li> <li><strong>Implement custom error pages</strong> to hide raw exception messages. To do this, simply add something like the following to your web.xml: <div class="syntax_hilite"><span class="langName"><br> </span> <div id="xml-2"> <div class="xml"> <ol> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><error</span>-page<span style="font-weight: bold; color: black;">></span></span></div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> <span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><error</span>-code<span style="font-weight: bold; color: black;">></span></span>404<span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"></error</span>-code<span style="font-weight: bold; color: black;">></span></span></div> </li> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> <span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><location<span style="font-weight: bold; color: black;">></span></span></span>/error/404.html<span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"></location<span style="font-weight: bold; color: black;">></span></span></span></div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"></error</span>-page<span style="font-weight: bold; color: black;">></span></span> </div> </li> </ol> </div> </div> </div> <p> </p> </li> <li><strong>Eliminate <code>System.out</code> and <code>System.err</code> statements</strong> from application code and use a logging toolkit such as <a href="http://logging.apache.org/log4j">Log4J</a> for application logging.</li> <li><strong>Leverage Tomcat's shared library directory.</strong> If you're loading several applications with several of the same library dependencies, consider moving them from the applications' <code>WEB-INF/lib</code> directory to Tomcat's shared library <code>{catalina.home}/shared/lib</code>. This will reduce the memory used by each application and result in smaller WAR files.<br> <br> </li> <li><strong>Tweak memory parameters.</strong> Most of the time you will want to make a change to the default settings. The best advice here is to create a development environment that matches your production environment and load test the application. While you do this you can also use a profiler to identify bottlenecks, etc.</li> <li><strong>Remove unnecessary applications. </strong></li> <li><strong>Secure the Manager application. </strong>By default there are no users with the manager role. To make use of the manager webapp you need to add a new role and user into the <code>CATALINA_HOME/conf/tomcat-users.xml</code> file. <div class="syntax_hilite"><span class="langName"><br> </span> <div id="xml-3"> <div class="xml"> <ol> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><role</span> <span style="color: rgb(0, 0, 102);">rolename</span>=<span style="color: rgb(255, 0, 0);">"manager"</span><span style="font-weight: bold; color: black;">></span></span></div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> <span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><user</span> <span style="color: rgb(0, 0, 102);">username</span>=<span style="color: rgb(255, 0, 0);">"darren"</span> <span style="color: rgb(0, 0, 102);">password</span>=<span style="color: rgb(255, 0, 0);">"ReallyComplexPassword"</span> <span style="color: rgb(0, 0, 102);">roles</span>=<span style="color: rgb(255, 0, 0);">"manager"</span><span style="font-weight: bold; color: black;">></span></span><span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"></user<span style="font-weight: bold; color: black;">></span></span></span></div> </li> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"></role<span style="font-weight: bold; color: black;">></span></span></span> </div> </li> </ol> </div> </div> </div> <p>Use a valve to filter by IP or hostname to only allow a subset of machines to connect (i.e. LAN machines). This can be configured at the Engine, Host, or Context level in the <code>conf/server.xml</code> by adding something like the following:</p> <div class="syntax_hilite"><span class="langName"><br> </span> <div id="xml-4"> <div class="xml"> <ol> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0);"><span style="color: rgb(128, 128, 128); font-style: italic;"><!-- allow only LAN IPs to connect to the manager webapp --></span></span></div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0);"><span style="color: rgb(128, 128, 128); font-style: italic;"><!-- contrary to the current Tomcat 5.5 documation the value for 'allow' is not a regular expression --></span></span></div> </li> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0);"><span style="color: rgb(128, 128, 128); font-style: italic;"><!-- future versions may have to be specified as 192.168.1.* --></span></span></div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><Valve</span> <span style="color: rgb(0, 0, 102);">className</span>=<span style="color: rgb(255, 0, 0);">"org.apache.catalina.valves.RemoteAddrValve"</span> <span style="color: rgb(0, 0, 102);">allow</span>=<span style="color: rgb(255, 0, 0);">"192.168.1.*"</span><span style="font-weight: bold; color: black;">></span></span><span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"></Valve<span style="font-weight: bold; color: black;">></span></span></span> </div> </li> </ol> </div> </div> </div> <p> </p> </li> <li><strong>Strip down <code>server.xml</code></strong> by removing comments to make it easier to read and remove connectors that you don't need. An easy way to do this is the following: Rename <code>CATALINA_HOME/conf/server.xml</code> to <code>CATALINA_HOME/conf/server-original.xml</code> and rename <code>CATALINA_HOME/conf/server-minimal.xml</code> to <code>CATALINA_HOME/conf/server.xml</code>. The minimal configuration provides the same basic configuration, but without the nested comments is much easier to maintain and understand. Do not delete the original file as the comments make it useful for reference if you ever need to make changes. Unless you are using Tomcat with the Apache server, comment out this line in <code>CATALINA_HOME/conf/server.xml</code>: <div class="igBar"><span id="lxml-5"><a href="http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/#" onclick="javascript:showPlainTxt('xml-5'); return false;"><br> </a></span></div> <div class="syntax_hilite"><span class="langName"></span> <span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><Connector</span> <span style="color: rgb(0, 0, 102);">port</span>=<span style="color: rgb(255, 0, 0);">"8009"</span> <span style="color: rgb(0, 0, 102);">enableLookups</span>=<span style="color: rgb(255, 0, 0);">"false"</span> <span style="color: rgb(0, 0, 102);">redirectPort</span>=<span style="color: rgb(255, 0, 0);">"8443"</span> <span style="color: rgb(0, 0, 102);">protocol</span>=<span style="color: rgb(255, 0, 0);">"AJP/1.3"</span><span style="font-weight: bold; color: black;">></span></span> <div id="xml-5"> <div class="xml"> <ol> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> </div> </li> </ol> </div> </div> </div> <p> </p> </li> <li><strong>Split your Tomcat installation for added flexibility when it comes time to upgrade Tomcat.</strong> See the <em>"Advanced Configuration - Multiple Tomcat Instances"</em> section in the RUNNING.txt file of the Tomcat distribution.</li> <li><strong><a href="http://tomcat.apache.org/tomcat-5.5-doc/jasper-howto.html#Web%20Application%20Compilation">Precompile JSPs</a> (at build time).<br> </strong></li> <li><strong>Secure directory listings</strong>. In <code>CATALINA_HOME/conf/web.xml</code>: <div class="syntax_hilite"><span class="langName"><br> </span> <div id="xml-6"> <div class="xml"> <ol> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><servlet<span style="font-weight: bold; color: black;">></span></span></span></div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> <span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><servlet</span>-name<span style="font-weight: bold; color: black;">></span></span>default<span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"></servlet</span>-name<span style="font-weight: bold; color: black;">></span></span></div> </li> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> <span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><servlet</span>-class<span style="font-weight: bold; color: black;">></span></span>org.apache.catalina.servlets.DefaultServlet<span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"></servlet</span>-class<span style="font-weight: bold; color: black;">></span></span> </div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> <span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><init</span>-param<span style="font-weight: bold; color: black;">></span></span></div> </li> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> <span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><param</span>-name<span style="font-weight: bold; color: black;">></span></span>debug<span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"></param</span>-name<span style="font-weight: bold; color: black;">></span></span></div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> <span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><param</span>-value<span style="font-weight: bold; color: black;">></span></span>0<span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"></param</span>-value<span style="font-weight: bold; color: black;">></span></span></div> </li> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> <span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"></init</span>-param<span style="font-weight: bold; color: black;">></span></span></div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> <span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><init</span>-param<span style="font-weight: bold; color: black;">></span></span></div> </li> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> <span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><param</span>-name<span style="font-weight: bold; color: black;">></span></span>listings<span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"></param</span>-name<span style="font-weight: bold; color: black;">></span></span></div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> <span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><param</span>-value<span style="font-weight: bold; color: black;">></span></span>false<span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"></param</span>-value<span style="font-weight: bold; color: black;">></span></span> <span style="color: rgb(0, 153, 0);"><span style="color: rgb(128, 128, 128); font-style: italic;"><!-- make sure this is false --></span></span></div> </li> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> <span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"></init</span>-param<span style="font-weight: bold; color: black;">></span></span></div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> <span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><load</span>-on-startup<span style="font-weight: bold; color: black;">></span></span>1<span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"></load</span>-on-startup<span style="font-weight: bold; color: black;">></span></span></div> </li> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"></servlet<span style="font-weight: bold; color: black;">></span></span></span> </div> </li> </ol> </div> </div> </div> <p> </p> </li> <li>If you have multi-core CPUs or more than one CPUs on your server, it might be beneficial to <strong>increase the thread pool beyond the default 250</strong>. On the other hand, if you have a slow server, decreasing the thread pool will decrease the overhead on the server.</li> <li><strong>Monitor application applications via Tomcat MBeans.</strong> This <a href="http://www.devx.com/Java/Article/32730/1954?pf=true">article</a> provides some great insight on how to do this.</li> <li><strong>Consider JDK 1.5 or even better JDK 1.6</strong> to take advantage of performance improvements.<br> <br> </li> <li><strong>Use the <code>-server</code> JVM option.</strong> This enables the server JVM, which JIT compiles bytecode much earlier, and with stronger optimizations. Startup and first calls will be slower due to JIT compilation taking more time, but subsequent ones will be faster.</li> <li><strong>Use GZIP compression</strong>. Look for the service connector you wish to configure for compression and add two attributes, <code>compression</code> and <code>compressableMimeType</code>. For example: <div class="igBar"><span id="lxml-7"><a href="http://www.digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/#" onclick="javascript:showPlainTxt('xml-7'); return false;"><br> </a></span></div> <div class="syntax_hilite"><span class="langName"> </span> <div id="xml-7"> <div class="xml"> <ol> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"><Connector<span style="font-weight: bold; color: black;">></span></span></span></div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> port="80"</div> </li> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> maxHttpHeaderSize="8192"</div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> URIEncoding="UTF-8"</div> </li> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> maxThreads="150"</div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> minSpareThreads="25"</div> </li> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> maxSpareThreads="75"</div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> enableLookups="false"</div> </li> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> redirectPort="8443"</div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> acceptCount="100"</div> </li> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> connectionTimeout="20000"</div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> disableUploadTimeout="true"</div> </li> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> compression="on"</div> </li> <li style="font-weight: bold; color: rgb(38, 83, 106);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"> compressableMimeType="text/html,text/xml,text/plain,application/xml"></div> </li> <li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"> <div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 153, 0);"><span style="font-weight: bold; color: black;"></Connector<span style="font-weight: bold; color: black;">></span></span></span> </div> </li> </ol> </div> </div> </div> <p>For more information, read the <a href="http://tomcat.apache.org/tomcat-5.5-doc/config/http.html">Tomcat HTTP Connector documentation</a>. </p> </li> <li>The default Tomcat configuration provides good protection for most requirements, but does not prevent a malicious application from compromising the security of other applications running in the same instance. To prevent this sort of attack, Tomcat can be run with a Security Manager enabled which strictly controls access to server resources. Tomcat documentation has a good section on <a href="http://tomcat.apache.org/tomcat-5.5-doc/security-manager-howto.html" class="external text" title="http://tomcat.apache.org/tomcat-5.5-doc/security-manager-howto.html" rel="nofollow">enabling the Security Manager.</a></li> </ol> <div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com2tag:blogger.com,1999:blog-6205172072186192698.post-11184948746730843562009-07-29T11:38:00.000-07:002009-07-29T11:43:45.101-07:00Choosing a Java Web Framework<div class="content"> <p>Choosing a Java Web framework for your project is not getting any easier. Here are some things I think about when choosing a Java Web framework.</p> <ul><li><strong>Is it action based?</strong> Action based frameworks generally map actions (defined in an HTML form or URL) to code in the controller tier of the application. Action based frameworks are the most popular type of framework. Most developers have had at least some exposure to these kinds of frameworks. The most popular Java Web framework, <a href="http://struts.apache.org/">Struts</a>, is an action based framework. <strong>Examples: Struts, <a href="http://struts.apache.org/2.x/">Struts2</a> (based on <a href="http://www.opensymphony.com/webwork/">WebWork</a>), <a href="http://www.springframework.org/docs/reference/mvc.html">Spring MVC</a>, <a href="http://stripes.mc4j.org/confluence/display/stripes/Home">Stripes</a>, <a href="http://www.rubyonrails.org/">Ruby on Rails</a> , <a href="http://grails.codehaus.org/">Grails</a></strong></li></ul><ul><li><strong>Is it component based?</strong> Component based frameworks create a component abstraction in the view tier. Event listeners capture user actions and map back to code in the controller tier. I am of the opinion that component based framework have a steeper learning curve than action based frameworks. Some will counter that component based frameworks offer greater productivity, once the framework is learned. Programming in a component based framework can sometimes feel like programming Java Swing components. <strong>Examples: <a href="http://java.sun.com/javaee/javaserverfaces/">JavaServer Faces</a> (JSF) implementations (<a href="http://myfaces.apache.org/">MyFaces</a>, <a href="http://tapestry.apache.org/">Tapestry</a>, <a href="http://rifers.org/">RIFE</a>, <a href="http://wicket.sourceforge.net/">Wicket</a>, <a href="http://code.google.com/webtoolkit/">Google Web Toolkit </a>(GWT), <a href="http://www.thinwire.com/">ThinWire</a>, <a href="http://www.nextapp.com/platform/echo2/echo/">Echo2</a>, <a href="http://www.icesoft.com/products/icefaces.html">IceFaces (JSF implementation)</a>, <a href="http://click.sourceforge.net/">Click</a></strong></li></ul><ul><li><strong>Is it page based?</strong> Page based frameworks allow you to develop application made of many Web pages. To implement these Web pages, the developer creates HTML (using JSPs or templates), JavaScript and CSS files. All action based frameworks (that I know of) and some component based frameworks are page based. Most of these frameworks now have good support for AJAX. Because you write the Web tier yourself, you also have a lot of control and the ability to adhere to Web standards. Struts is a page based framework. <strong>Examples: Struts, Struts2/WebWork, Spring MVC, Stripes, Ruby on Rails (requires JRuby to run in Java), Grails, RIFE, JavaServer Faces (JSF) implementations (MyFaces), Tapestry, RIFE, Wicket</strong></li></ul><ul><li><strong>Is the Web tier generated?</strong> New AJAX frameworks such as Google Web Toolkit, require you to only code in Java. They then generate the entire Web tier for you, so you don’t have to code the HTML, JavaScript or CSS. You will still need to understand CSS concepts in order to style you components. This may be attractive you if you or your team doesn’t have much experience with JavaScript and CSS or you want to keep all of you application logic within Java code. These frameworks are component based and the style of programming is very similar to Swing. AJAX is used heavily by these framework to create a rich user interface. In traditional frameworks, there are many Web pages that work together to form an application. These frameworks may only have one page (a frame) where components and screens are swapped out using AJAX. <strong>Examples: Google Web Toolkit (GWT), ThinWire, Echo2, IceFaces (JSF implementation)</strong></li></ul><ul><li><strong>Is it JSP based?</strong> Many frameworks, including Struts, use <a href="http://java.sun.com/products/jsp/">JSP</a> pages to generate HTML. JSP (JavaServer Pages) are the classic way to generate Web pages in Java. Tag libraries are used within JSP pages to generate HTML. Custom tags can be created fairly easily to add your own functionality. JSP pages get compiled into <a href="http://java.sun.com/javaee/javaserverfaces/">Java Servlets</a>. <strong>Examples: Struts, Struts2/WebWork, Spring MVC, JavaServer Faces (JSF) implementations (MyFaces), Click</strong></li></ul><ul><li><strong>Is it template based?</strong> Some frameworks offer an alternative to JSP pages known as a template. Sometimes a framework only works with templates, while there are also lightweight template libraries, such as Velocity or FreeMarker, that can be used in combination with JSP frameworks. A template is often an HTML file with references to Java components made within the HTML code. Because these files are not JSP pages, they bypass the JSP API which many developers do not like to use. This also give some templates the ability to be viewed by a browser, which makes them nice for Web designers. I list some examples of frameworks that use template out of the box. However, as I mentioned earlier, JSP based frameworks can be made to work with templating technologies. <strong>Examples: <a href="https://facelets.dev.java.net/">Facelets</a> (a view handler that can be used with any JSF implementation), Tapestry, RIFE, Wicket, <a href="http://velocity.apache.org/">Velocity</a>, <a href="http://shale.apache.org/shale-clay/index.html">Clay</a> (part of <a href="http://shale.apache.org/">Shale</a>), <a href="http://www.freemarker.org/">FreeMarker</a></strong></li></ul><ul><li><strong>Is it Rails like?</strong> The hugely popular Ruby on Rails (RoR) framework has defined its own class of Web framework. Without going into the framework itself, two fundamentals of this framework are “convention over configuration” and “don’t repeat yourself”. Rails like frameworks generate a lot of the application structure up front to make it easy to get up and running. <strong>Examples: Ruby on Rails (requires JRuby to run in Java), Grails, <a href="http://www.trailsframework.org/">Trails</a></strong></li></ul><ul><li><strong>Does it support a dynamic scripting language?</strong> Many frameworks now have support for dynamic scripting frameworks. If you would rather do most of your Web programming in a scripting language rather than Java (there are many who would), then one of these frameworks might be for you. They tend to be action and page based and have good support for AJAX. <strong>Examples: Ruby on Rails (requires JRuby to run in Java), Grails (using <a href="http://groovy.codehaus.org/">Groovy</a> scripting language)</strong></li></ul><ul><li><strong>Does it support IoC?</strong> You will often hear this referred to as “Spring integration”. The <a href="http://www.springframework.org/">Spring Framework</a> is a full stack J2EE application framework. There are many different sub-frameworks within the Spring Framework, and its <a href="http://www.springframework.org/docs/reference/beans.html">Spring IoC</a> (inversion of control or dependency injection) framework is its most widely used. IoC frameworks can make it easy to configure Java beans within your application, as well as provide a number of other benefits. Most of the popular frameworks have support in one way or another for Spring IoC. If this is important to you, then you should make sure the framework you are selecting makes it easy to work with Spring IoC. There are other IoC frameworks out there, such as <a href="http://hivemind.apache.org/">HiveMind</a> and <a href="http://plexus.codehaus.org/">Plexus</a>, but Spring is currently the standard.</li></ul><ul><li><strong>Does it support Web conversations?</strong> Supporting <a href="http://evolutionarygoo.com/blog/?p=79">Web conversations</a> is about tracking state across several pages, so if you are using a framework that is page based, then this may be important to you. If it is, then <a href="http://www.jboss.com/products/seam">JBoss Seam</a> and <a href="http://www.springframework.org/go-webflow">Spring Web Flow</a> are frameworks to consider. They are not Web frameworks, but server side frameworks that integrate into the middle tier of your application. Seam uses JSF for its Web tier. Spring Web Flow can integrate with various Web frameworks. Shale, a framework for JSF, also includes support for conversations, as well as RIFE.</li></ul><ul><li><strong>Is it testable?</strong> Many of the popular frameworks are building in formal support for mock objects and other testing concerns. Testing is critical and Web applications tend to be difficult to test.</li><li><strong>How well does it support security? Is it well supported and maintained? Is it stable? Will it help me adhere to standards?</strong> These are things I think about on all projects when selecting a framework and they apply here as well. Especially here, since there are so many Java Web frameworks to choose from and new ones are showing up each month.</li></ul></div><div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com9tag:blogger.com,1999:blog-6205172072186192698.post-15031550381664358292009-07-27T23:22:00.000-07:002009-07-28T10:20:40.326-07:00Technologies used to censor the Web<p><b>IP Blocking</b></p> <p>IP Blocking is one of the most basic methods for censorship, as it simply prevents all packets going to or from targeted IP addresses.<br /></p> <p>But while these sorts of operations are relatively simple to execute, they don't tackle the problem of individual communications between users, especially if the users have set up multi-hop circuits that use multiple servers to create a proxy ring.<br /></p><p><b>Traffic Classification (QoS)</b></p> <p>This is a much more sophisticated method of blocking traffic than IP blocking, as one can halt any file sent through a certain type of protocol, such as FTP. Because we know that FTP transfers are most often sent through TCP port 21, they can simply limit the bandwidth available on that port and throttle transfers. "it is not too resource intensive and is fairly easy to set up."<br /></p><p><b>Shallow Packet Inspection</b></p> <p>Shallow packet inspection is basically a blunter, broader version of the deep packet inspection (DPI) technique that is used to block packets based on their content. But unlike DPI, which intercepts packets and inspects their fingerprints, headers and payloads, shallow packet inspection makes broad generalities about traffic based solely on checking out the packet header.<br /></p> <p>"Shallow packet inspection is more judging a book by its cover. If a packet says that it's SSL (Secure Sockets Layer) in the header, then a shallow packet inspector takes it at face value." </p> <p><b>Packet Fingerprinting</b></p> <p>This is a slightly more refined method of throttling packets than shallow packet inspection, as it looks not only at the packet header but at its length, frequency of transmission and other characteristics to make a rough determination of its content. </p> <p>"A lot of things don't explicitly say what they are. For example, a lot of VPN traffic is indistinguishable from SSH traffic, which means that it would be throttled if SSH was,". "But what if businesses relied on VPN connections? You'd move the system to fingerprinting, where the two are easily distinguishable."<br /></p><p><b>Deep Packet Inspection / Packet Content Filtering</b></p> <p>DPI is the most refined method for blocking Internet traffic. As mentioned above, deep packet inspectors examine not only a packet's header but also its payload. This gives the ability to filter packets at a more surgical level than any of the other techniques discussed so far. </p> <p>"Viewing a packet's contents doesn't tell you much on its own, especially if it's encrypted," . "But combining it with the knowledge gained from fingerprinting and shallow packet inspection, it is usually more than enough to figure out what sort of traffic you're looking at." </p><div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com0tag:blogger.com,1999:blog-6205172072186192698.post-44081751869240783612009-06-18T04:22:00.000-07:002009-06-27T22:11:24.680-07:00CentOS x64 bit: Installing Flash plugin for FFDownload flash plugin from <a href="http://labs.adobe.com/downloads/flashplayer10.html">http://labs.adobe.com/downloads/flashplayer10.html</a><br /><br />then in terminal:<br /><br /><br />$ tar -xf libflashplayer-10.0.22.87.linux-x86_64.so.tar.gz<br />$ sudo cp libflashplayer.so /usr/lib64/mozilla/plugins/<br /><br />Restart firefox-64 bit.<br /><br /><span style="color: rgb(255, 255, 255);">fxd2tbina4</span><div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com0tag:blogger.com,1999:blog-6205172072186192698.post-34417495760964009912009-06-17T10:16:00.000-07:002009-06-17T10:31:51.239-07:00IE vs Firefox in Progressive Rendering<span class="Apple-style-span" style=" -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-family:verdana;font-size:13px;">Progressive rendering is the act of displaying each object as it is downloaded. Both IE and FF supports progressive rendering; but, they differ on how they render tables.</span><div><span class="Apple-style-span" style="font-family:verdana;font-size:100%;"><span class="Apple-style-span" style=" -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;font-size:13px;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:verdana;font-size:100%;"><span class="Apple-style-span" style=" -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;font-size:13px;"><span style="font-family:Trebuchet MS;"><span style="font-size:130%;"><b>Internet Explorer 7</b></span></span><br /><br />When Internet Explorer renders a , it downloads all the objects within the table before displaying it. This is required so that Internet Explorer can render the table with the correct width for each column.<div><span class="Apple-style-span" style="font-family:verdana;font-size:100%;"><span class="Apple-style-span" style=" -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;font-size:13px;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:verdana;font-size:100%;"><span class="Apple-style-span" style=" -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;font-size:13px;"><span style="font-family:Trebuchet MS;"><span style="font-size:130%;"><b>Mozilla Firefox</b></span></span><br /><br />On the other hand, Firefox renders all objects progressively regardless if it's in a table. That is to say - each object is displayed as soon as it is downloaded.</span></span></div><div><span class="Apple-style-span" style="font-family:verdana;font-size:100%;"><span class="Apple-style-span" style=" -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;font-size:13px;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:verdana;font-size:100%;"><span class="Apple-style-span" style=" -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;font-size:13px;"><span style="font-family:Trebuchet MS;"><span style="font-size:130%;"><b>What You Can Do To Improve Performance</b></span></span><br /><br /><b>Performance Tips</b><ol style="font: normal normal normal 12px/normal Verdana, Arial, Helvetica, sans-serif; line-height: 1.3em; list-style-type: decimal; "><li style="font: normal normal normal 12px/normal Verdana, Arial, Helvetica, sans-serif; line-height: 1.3em; ">Ensure HTML code is valid.</li><li style="font: normal normal normal 12px/normal Verdana, Arial, Helvetica, sans-serif; line-height: 1.3em; ">Minimize number of nested tables.</li><li style="font: normal normal normal 12px/normal Verdana, Arial, Helvetica, sans-serif; line-height: 1.3em; ">Never wrap entire body contents within a table.</li><li style="font: normal normal normal 12px/normal Verdana, Arial, Helvetica, sans-serif; line-height: 1.3em; ">Move towards a CSS-based layout.</li><li style="font: normal normal normal 12px/normal Verdana, Arial, Helvetica, sans-serif; line-height: 1.3em; ">Move JavaScript to the very bottom of document (right before the tag). If not possible, move JavaScript to the of document.</li><li style="font: normal normal normal 12px/normal Verdana, Arial, Helvetica, sans-serif; line-height: 1.3em; ">Pay close attention to the size of objects and their locations?</li></ol><span style="font-family:Trebuchet MS;"><span style="font-size:130%;"><b>The Key Is To Understand</b></span></span><br /><br />By knowing each browser's strengths and weaknesses, you can build a better design. A good design will never make the reader wait. </span></span></div><div><span class="Apple-style-span" style="font-family:verdana;font-size:100%;"><span class="Apple-style-span" style=" -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;font-size:13px;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:verdana;font-size:100%;"><span class="Apple-style-span" style=" -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;font-size:13px;"><br /></span></span></div><table><tbody></tbody></table></span></span></div><div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com1tag:blogger.com,1999:blog-6205172072186192698.post-69002886366533487932009-06-17T03:16:00.000-07:002009-06-17T03:23:51.678-07:00Eclipse look and feel for swing applications<span style="font-size:100%;">This is what you were looking for. There is an open source API called <b>SWT(Standard Widget Toolkit)</b> by eclipse. A GUI </span>framework for Swing user interfaces. You can see the list of swt widgets here <a class="moz-txt-link-freetext" href="http://www.eclipse.org/swt/widgets/">http://www.eclipse.org/swt/widgets/</a>. Using this framework we can build application like eclipse look and feel.<div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com0tag:blogger.com,1999:blog-6205172072186192698.post-77057387782172065412009-06-13T01:05:00.000-07:002009-06-13T01:08:04.027-07:00Classpath Helper<div>H<span class="Apple-style-span" style=" ;font-family:verdana;">ow to find unused Jar libs in a huge application?</span></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span class="Apple-style-span" style="font-family:verdana;"><span class="Apple-style-span" style=" ;font-family:Georgia;">I think this tool(classpath helper) answers, <a href="http://classpathhelper.sourceforge.net/">http://classpathhelper.sourceforge.net/</a></span></span></div><div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com0tag:blogger.com,1999:blog-6205172072186192698.post-74804978101920461772009-06-12T23:50:00.001-07:002009-06-12T23:50:31.803-07:00What is Google Wave?<span class="Apple-style-span" style="font-family: 'Lucida Grande'; font-size: 14px; line-height: 20px; "><a href="http://wave.google.com/" style="color: rgb(128, 0, 128); ">Google Wave</a> is a new communication service previewed today at <a href="http://code.google.com/events/io/" style="color: rgb(0, 0, 255); ">Google I/O</a>. "A wave is equal parts conversation and document, where people can communicate and work together with richly formatted text, photos, videos, maps, and more."<br /><br />The service seems to combine Gmail and Google Docs into an interesting free-form workspace that could be used to write documents collaboratively, plan events, play games or discuss a recent news.</span><div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com0tag:blogger.com,1999:blog-6205172072186192698.post-88065640088393197032009-06-11T06:43:00.000-07:002009-06-11T06:45:08.345-07:00Running tomcat on port 80 as non-root<ul><li><strong>Use the <a href="http://httpd.apache.org/" target="_blank">Apache httpd server</a> to “pass” requests to Tomcat. </strong></li></ul><ul><li><strong>Use <a href="http://en.wikipedia.org/wiki/Iptables" target="_blank">IPtables</a>.</strong> This requires a kernel version of 2.4.x or higher. If you’re running an older version of the kernel take a look at <a href="http://en.wikipedia.org/wiki/Ipchains" target="_blank">IPChains</a> and consider a command something like:<code> ipchains -I input --proto TCP --dport 80 -j REDIRECT 8080</code> <p>The IPtables solution allows Tomcat to run as an independent server as a non-privileged user and listen on port 80. IPtables will redirect all requests coming in on port 80 to port 8080 or whatever port you have Tomcat running under.The first step for this solution is to make sure your firewall allows TCP requests on port 8080 (or whatever port your Tomcat configuration has specfied). Essentially you need to duplicate all the firewall rules you have configured for port 80 since you will be redirecting those requests to 8080. The second step is to use the iptables command (usually installed by default on linux distributions) to redirect all packets on port 80, to port 8080. Here is a an example of the command you would use to do this:<br /><code><br />iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -j REDIRECT --to-port 8080<br /></code></p> To redirect local requests use the following command:<code>iptables -t nat -A OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-port 8080</code><br />This is handy if you’re running Tomcat on your workstation and debugging an application that’s required to run on port 80.</li></ul><ul><li><strong>Use rinetd. </strong>rinetd is a dedicated port redirector program that receives a packet and redirects it to a different port or address. Since rinetd redirects packets after they’ve gone through IPtables, this solution can be used for local and non-local requests.There are two things you should consider when using rinetd. First, rinetd cannot be used to redirect <strong><a href="http://en.wikipedia.org/wiki/Ftp" target="_blank">FTP</a></strong> requests because FTP requires more than one socket. Secondly, rinetd makes all packets appear as though they originated from the local machine. This obviously will impact things like web server logs and setting permissions based on IP address.Although rinetd has these side effects, using a combination of iptables and rinetd may be another option but seems like a more complicated solution from a debugging and maintenance perspective.</li></ul><div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com1tag:blogger.com,1999:blog-6205172072186192698.post-46649510261724963262009-06-06T08:42:00.000-07:002009-06-06T08:50:13.777-07:00Installing self-signed ssl certificate1. Generate an RSA key for signing the certificate:<br />openssl genrsa -out mykey.pem 2048<br /><br />2. Generate a certificate using the new key:<br />openssl req -new -x509 -key mykey.pem -out mycert.pem -days 365<br /><br />Enter your name, organization name and address as prompted.<br />In this example, we've created a key file, mykey.pem, and a self-signed certificate. Normally, you want a certificate from a "certificate authority" or CA. <br />3. Since the certificate is in PEM format, convert it to PKCS12 for Tomcat:<br />openssl pkcs12 -export -in mycert.pem -inkey mykey.pem -out mycert.p12 -name tomcat<br /><br />You MUST specify an export password! Tomcat expects one.<br /><br />4. Keep the “mycert.p12” file you will need it to configure in tomcat server.xml.<br /><br />5. Edit $CATALINA_HOME/conf/server.xml and uncomment the SSL connector tag.<br /> Connector port="8443" maxHttpHeaderSize="8192"<br /> maxThreads="150" minSpareThreads="25" maxSpareThreads="75"<br /> enableLookups="false" disableUploadTimeout="false" proxyPort="443"<br /> acceptCount="100" scheme="https" secure="true"<br /> clientAuth="false" sslProtocol="TLS" keystoreType="PKCS12" <br /> keystoreFile="/opt/openssl-0.9.8g/mycert.p12" <br /> keystorePass="*****" />"<div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com1tag:blogger.com,1999:blog-6205172072186192698.post-55358715745476650862009-06-06T08:16:00.000-07:002009-06-06T08:19:22.925-07:00Google's Page Speed<span class="Apple-style-span" style="font-family: verdana; font-size: 15px; line-height: 19px; ">Google has released a Firefox add-on called <a href="http://code.google.com/speed/page-speed/download.html" style="color: rgb(0, 0, 0); text-decoration: underline; ">Page Speed</a>. It integrates with another add-on, <a href="http://getfirebug.com/" style="color: rgb(169, 64, 29); text-decoration: underline; ">Firebug</a>, and is aimed at web developers trying to make their pages faster. “Page Speed is a tool we’ve been using internally to improve the performance of our web pages,” </span><div><span class="Apple-style-span" style="font-family: verdana; font-size: 15px; line-height: 19px;"><br /></span></div><div><span class="Apple-style-span" style="font-family: verdana; font-size: 15px; line-height: 19px;"><span class="Apple-style-span" style="font-size: 14px; line-height: 16px; ">Also see <a href="http://developer.yahoo.com/yslow/" style="color: rgb(169, 64, 29); text-decoration: underline; ">YSlow</a>, another Firebug add-on (this time by Yahoo) that “analyzes web pages and suggests ways to improve their performance”.</span><br /></span></div><div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com0tag:blogger.com,1999:blog-6205172072186192698.post-58068016263955548352009-06-01T09:21:00.001-07:002009-06-01T09:28:04.185-07:00Best Ajax FrameworkThere are lot of ajax frameworks out there, my pick is<div><br /></div><div><ul><li><a href="http://www.dojotoolkit.org/">Dojo </a>- <span class="Apple-style-span" style="font-family: Lucida; font-size: 13px; line-height: 16px; "> </span><span class="Apple-style-span" style="font-family: Lucida; line-height: 16px; "><span class="Apple-style-span" style="font-size: medium;">Provides more features and widgets but customization is harder</span></span></li><li><a href="http://developer.yahoo.com/yui/">YUI </a>- h<span class="Apple-style-span" style="font-size: medium;">as </span><span class="Apple-style-span" style="font-family: Lucida; line-height: 16px; "><span class="Apple-style-span" style="font-size: medium;">well documented code and detailed tutorial.</span></span></li><li><span class="Apple-style-span" style="font-family: Lucida; line-height: 16px;"><a href="http://code.google.com/webtoolkit/">GWT </a>- Google's framework :-)</span></li><li><a href="http://sweetdev-ria.sourceforge.net/sweetdev-ria3.2/">SweekDev Ria</a> - Has more features and performance overheads</li></ul><div><br /></div></div><div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com0tag:blogger.com,1999:blog-6205172072186192698.post-85153494115926285122009-05-17T05:53:00.000-07:002009-05-17T05:55:35.655-07:00First Web Server<img src="http://farm1.static.flickr.com/114/298160250_8273b83f2b.jpg?v=0" alt="The World's First Web Server by sbisson." /><div><br /></div><div><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; ">In a glass case at <a href="http://www.itpro.co.uk/blogs/maryb/2008/09/10/the-lhc-isnt-the-only-geek-magnet-at-cern/" rel="nofollow" style="color: rgb(16, 87, 174); text-decoration: underline; ">CERN</a> is an unpreposessing little NeXT cube. It's hard to believe that this little workstation changed the world, but it did. It's Tim Berners Lee's original web server, the world's first.</span><br /></div><div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com0tag:blogger.com,1999:blog-6205172072186192698.post-57711891060085177072009-05-13T21:18:00.001-07:002009-05-13T21:18:59.016-07:00Google Launches Search Options, Declares Real-Time Search Biggest Challenge<p><img src="http://www.techcrunch.com/wp-content/uploads/2009/05/goog-search-options.jpg" /></p> <p>Google has just launched a new “search options” feature on its main search page. When you click on “Search options” you can filter your search by different types of results (videos, forums, and reviews), by time (recent, past 24 hours, past week, past year), as well as seeing related searches, a “wonder wheel” view, or a timeline view.</p> <p>At Google’s <a href="http://www.techcrunch.com/2009/05/12/live-from-google-searchology/">Searchology</a> event, which is going on right now, Marissa Mayer listed the following as the hardest unsolved problems in search:</p> <p>- Finding the most recent information<br />- Expressing that you want just one type of result<br />- Assessing which results are best<br />- Knowing what you’re looking for<br />- Expressing your searches in keywords</p> <p>Notice that real-time search is the No. 1 problem. (Twitter and a bunch of startups from <a href="http://www.techcrunch.com/2009/05/12/twitter-is-talking-real-time-link-search-but-oneriot-is-launching-it-today/">OneRiot</a> to <a href="http://www.techcrunch.com/2009/05/12/tweetmeme-launches-the-second-real-time-tweet-link-search-this-hour/">Tweetmeme</a> are also working on it, with the latter two launching their own real-time search efforts today). And it certainly is a problem for Google, even with the new recent results option. Try searching for any of teh top trending results on Twitter right now like <a href="http://www.google.com/#hl=en&tbo=1&tbs=rcnt%3A1&q=Miss+california&fp=rA1UKHGhp_w">Miss California<img id="snap_com_shot_link_icon" class="snap_preview_icon" style="border: 0pt none ; margin: 0pt ! important; padding: 1px 0pt 0pt; max-height: 2000px; max-width: 2000px; min-width: 0px; min-height: 0px; font-style: normal; font-weight: normal; font-family: "trebuchet ms",arial,helvetica,sans-serif; float: none; position: static; left: auto; top: auto; line-height: normal; background-image: url(http://i.ixnp.com/images/v3.80/theme/silver/palette.gif); background-color: transparent; visibility: visible; width: 14px; height: 12px; background-position: -1128px 0pt; background-repeat: no-repeat; text-decoration: none; vertical-align: top; display: inline;" src="http://i.ixnp.com/images/v3.80/t.gif" /></a> (vs. <a href="http://twitter.com/#search?q=%22Miss%20California%22">Twitter search results<img id="snap_com_shot_link_icon" class="snap_preview_icon" style="border: 0pt none ; margin: 0pt ! important; padding: 1px 0pt 0pt; max-height: 2000px; max-width: 2000px; min-width: 0px; min-height: 0px; font-style: normal; font-weight: normal; font-family: "trebuchet ms",arial,helvetica,sans-serif; float: none; position: static; left: auto; top: auto; line-height: normal; background-image: url(http://i.ixnp.com/images/v3.80/theme/silver/palette.gif); background-color: transparent; visibility: visible; width: 14px; height: 12px; background-position: -1128px 0pt; background-repeat: no-repeat; text-decoration: none; vertical-align: top; display: inline;" src="http://i.ixnp.com/images/v3.80/t.gif" /></a>) or <a href="http://www.google.com/#hl=en&tbo=1&tbs=rcnt%3A1&q=Star+Trek&fp=rA1UKHGhp_w">Star Trek<img id="snap_com_shot_link_icon" class="snap_preview_icon" style="border: 0pt none ; margin: 0pt ! important; padding: 1px 0pt 0pt; max-height: 2000px; max-width: 2000px; min-width: 0px; min-height: 0px; font-style: normal; font-weight: normal; font-family: "trebuchet ms",arial,helvetica,sans-serif; float: none; position: static; left: auto; top: auto; line-height: normal; background-image: url(http://i.ixnp.com/images/v3.80/theme/silver/palette.gif); background-color: transparent; visibility: visible; width: 14px; height: 12px; background-position: -1128px 0pt; background-repeat: no-repeat; text-decoration: none; vertical-align: top; display: inline;" src="http://i.ixnp.com/images/v3.80/t.gif" /></a> (vs. <a href="http://twitter.com/#search?q=%22Star%20Trek%22">Twitter results<img id="snap_com_shot_link_icon" class="snap_preview_icon" style="border: 0pt none ; margin: 0pt ! important; padding: 1px 0pt 0pt; max-height: 2000px; max-width: 2000px; min-width: 0px; min-height: 0px; font-style: normal; font-weight: normal; font-family: "trebuchet ms",arial,helvetica,sans-serif; float: none; position: static; left: auto; top: auto; line-height: normal; background-image: url(http://i.ixnp.com/images/v3.80/theme/silver/palette.gif); background-color: transparent; visibility: visible; width: 14px; height: 12px; background-position: -1128px 0pt; background-repeat: no-repeat; text-decoration: none; vertical-align: top; display: inline;" src="http://i.ixnp.com/images/v3.80/t.gif" /></a>), and you don’t even get any Twitter results on Google.</p> <p>While real-time search is still a big problem, it is not the only problem. Some of the new options address the difficulty of searching back through time. The recent results get as real-time as Google can get, but you can also expand the timeframe. And you can look at an actual timeline of results, which looks for dates within results and then places them chronologically (this is sort of hit or miss—just because a date is mentioned in a text does not mean the entire result is about or from that period of time). Google now also lets you see related searches as an option. And the Wonder Wheel is more of a visual aid to see how different related topics are clustered together. When you click on any spoke of the wheel, it then causes that search term to be at the center. We’ve seen many of these techniques in the past, but Google is giving them a higher profile by putting them in its main search page..</p> <p><img src="http://www.techcrunch.com/wp-content/uploads/2009/05/solar-ovens-timeline.jpg" /></p> <p><img src="http://www.techcrunch.com/wp-content/uploads/2009/05/solar-ovens-wnder-wheel.jpg" /></p><div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com0tag:blogger.com,1999:blog-6205172072186192698.post-21688578678255053562009-05-12T03:00:00.000-07:002009-05-12T03:04:43.831-07:00Accessing Remote Database from MySQL TriggerRecently, we were in need of accessing the remote machine database from the MySQL's trigger. We found the only way to get this done by using the <a href="http://dev.mysql.com/doc/refman/5.0/en/federated-storage-engine.html">FEDERATED</a> storage engine.<br /><br />The FEDERATED storage engine is available beginning with MySQL 5.0.3. It is a storage engine that accesses data in tables of remote databases rather than in local tables.<br /><br />The FEDERATED storage engine is available beginning with MySQL 5.0.3. This storage engine enables data to be accessed from a remote MySQL database on a local server without using replication or cluster technology. When using a FEDERATED table, queries on the local server are automatically executed on the remote (federated) tables. No data is stored on the local tables.<div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com0tag:blogger.com,1999:blog-6205172072186192698.post-88449074502582898702009-04-24T10:51:00.001-07:002009-04-24T10:54:54.934-07:00Internet Connection Speed: Top 10 Contries<span class="Apple-style-span" style="border-collapse: separate; color: rgb(102, 102, 102); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Verdana;font-size:12;" ><p>At the end of 2008, approximately 19 per cent<span class="Apple-converted-space"> </span><a title="Internet Connections" href="http://www.techpark.net/2008/06/11/internet-now-and-then/" target="_blank" style="border-style: none; text-decoration: none; color: rgb(53, 106, 160);">Internet connections</a><span class="Apple-converted-space"> </span>around the world were at speeds greater than 5 Mbps — a 21 per cent increase over the average global connection speed at the end of 2007.</p><p>This is according to the State of the Internet report, a quarterly study by Akamai Technologies, the US-based Internet content distribution giant. The State of the Internet report tracks average connection speeds for countries around the world.</p><p>Check out the top 10 nations in terms of average Internet connection speed.</p><p><strong>1. South Korea</strong></p><p>South Korea rules supreme when it comes to Internet connection speed and broadband connectivity. It is the world’s No.1 with average connection speed of 15 Mbps, ten times the global average!</p><p>During 2008, South Korea’s rate of quarterly change appeared to be locked into a cyclical pattern, with quarterly decreases being recorded in the first and third quarters, and increases seen in the second and fourth quarters.</p><p><span id="more-357"></span></p><p>For the whole year, South Korea saw a modest 7 per cent rise in their levels of high broadband adoption. South Korea is also ranked first in terms of high broadband connectivity with 69 per cent connections above 5 Mpbs.</p><p><strong>2. Japan</strong></p><p>Japan ranks 2nd in terms of Internet connection and high broadband connectivity.<span class="Apple-converted-space"> </span><a title="Internet Research In Japan" href="http://www.techpark.net/2007/08/24/japan-new-internet-by-2020/" target="_blank" style="border-style: none; text-decoration: none; color: rgb(53, 106, 160);">Japan</a><span class="Apple-converted-space"> </span>ranks 2nd in terms of high broadband connectivity. About 54 per cent of the connections in Japan are above 7 Mbps.</p><p><strong>3. Hong Kong</strong></p><p>Hong Kong ranks third with an Internet connection speed of 6.9 Mbps. The country ranks fifth in terms of high broadband connectivity with 38 per cent of the connection above 5 Mbps.</p><p><strong>4. Romania</strong></p><p>Romania is at the fourth position with a Internet connection speed of 5.7 Mbps. The country ranks third in terms of high broadband connectivity with 45% of the connection above 5 Mbps.</p><p><strong>5. Sweden</strong></p><p>Sweden is at the fifth position with a Internet connection speed of 5.6 Mbps. Sweden ranks fourth in terms of high broadband connectivity with 39 per cent of the connection above 5Mbps.</p><p><strong>6. Switzerland</strong></p><p>Switzerland has bagged the sixth position with an Internet connection speed of over 5 Mbps. The country however does not figure in the top ten list of countries with high broadband connectivity.</p><p><strong>7. Netherlands</strong></p><p>Netherlands ranks 7th with an Internet connection speed of 4.9 Mbps. The country ranks 7th in terms of high broadband connectivity with 28 per cent of the connections above 5 Mbps.</p><p><strong>8. Belgium</strong></p><p>Belgium is at the 8th position with an Internet connection speed of 4.7 Mbps. The country ranks sixth in terms of high broadband connectivity with 31 per cent of the connection above 5 Mbps.</p><p><strong>9. Slovakia</strong></p><p>Slovakia bags the ninth position with an Internet connection speed of 4.5 Mbps. The country does not figure among the top ten in terms of high broadband connectivity.</p><p><strong>10. Norway</strong></p><p>Norway ranks tenth with an Internet connection speed of 4.5 Mbps. The country ranks fifth in terms of high broadband connectivity with 38 per cent of the connection above 5 Mbps.</p><p><strong>United States</strong><span class="Apple-converted-space"> </span>is at the 17th position with an Internet connection speed of 3.9 Mbps, up approximately 8 per cent from the average connection speed for the first quarter of 2008.</p><p>In terms of Internet connection speed,<span class="Apple-converted-space"> </span><strong>China</strong><span class="Apple-converted-space"> </span>is way behind leading economies with an average Internet connection speed of 833 kbps.</p><p><strong>India</strong><span class="Apple-converted-space"> </span>has been ranked at a dismal 115th among 223 countries in terms of average Internet connection speeds. India has an average Internet connection speed of just 772 Kbps compared with the global average of 1.5 Mbps.</p><p><span style="font-weight:bold;"><span style="font-style:italic;">I think now we are in the first place, as Airtel BroadBand introduces 16 Mbps Speed :-)</span><span style="font-style:italic;"></span></span><br /></p></span><div class="blogger-post-footer"><a href="http://secure.bidvertiser.com/performance/bdv_rss_rd.dbm?pid=245891&bid=632231&PHS=245891632231&click=1&rsrc=3" target="_blank"><img src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=245891&bid=632231&PHS=245891632231&rssimage=1&rsrc=3" border="0"/></a></div>Manoj Manirajhttp://www.blogger.com/profile/05509661961470608823noreply@blogger.com2