Skip to main content

Posts

Deploying Web Service in Apache AXIS2

The purpose of this article is to talk about how to write web service and deploy it in Apache AXIS2. First step is downloading and installing apache axis2. There are two ways to use Apache AXIS2. 1. Install AXIS2 as a standalone server using the Standard Binary Distribution. 2. Deploy axis2.war and deploy it in a servlet container. We will be using the 2nd method in the article. To check the installation open the url http://localhost:8080/axis2 and you should be able to see the home page of apache axis2. Please locate the folder axis2\WEB-INF\services in exploded war file of axis2. This is the folder where you will copy the code of your service and it will get deployed in apache axis2. Lets us take a simple example. Write your service class. public class HelloWorld { public String sayHello(String firstName, String lastName) { System.out.println("Hello World Invoked"); MessageContext incomingContext = MessageContext.getCurrentMessageContext(); FileDataSourc...

Getting Started with Apache Lucene

Apache Lucene is a high-performance, full-featured text search engine library. The API of lucene is very simple to use. Here is overview of some of the objects required to start using Apache Lucene. Document and Fields The class "org.apache.lucene.document.Document" is necessary container for the index. Lucene requires all indexed objects to provide an instance of Document. Each document defines one or several fields ( (org.apache.lucene.document.Field). Fields contain classified information about the document or metadata related to document. A sample classification is for example the creation date of a file, author of the document etc. These fields allow you to search later for a specific information in this classification. IndexWriter The class org.apache.lucene.index.IndexWriter creates the index. Via the method addDocument you can add an existing Document to the index. The constructor for IndexWriter expects the directory to store the index, and the analyzer f...

Calling Struts Action by Javascript

To call a struts action by Javascript on an event, you need to write a function which is invoked when the event occurs and this function makes an AJAX call. The AJAX call can send a request to the same URL which is provided in action attribute of form tag or html:form tag. e.g. In case your action URL is something like "/registerUserAction.do?action=forgetPasswordForward" that you provide in action attribute of html:form, you can pass the same url to the mentioned code snippet below: function makeRequest(url, callbackfunction) { var http_request = getXMLHttpObject(); url = url + "isComingFromAjax=true"; if (url.indexOf('?') != -1) { url = url + "&" ; } else { url = url + "?" ; } url = url + "isComingFromAjax=true"; http_request.onreadystatechange = callbackfunction; http_request.open('POST', url.substring(0, url.indexOf('?')), true); http_request.setRequestHeader('Content-Type...

Choosing a LCD

Well, few months back I got confused when I saw so many LCDs of Sony, Hitachi, Philips, Samsung Sansui. I visited many showrooms and what I discovere that in one showroom I found Samsung as the best and in other Sony was the best, if you get confused obviously most people would end up with Sony. But then I realised dealers promote one or the other brand and they keep that unit in best settings.So, I jumped into a shop and got the remotes of all LCDs and when I set all of them on same brightness, sharpness level, it was a minute job for me to go for hitachi. Shopkeepers will tell you about so many factors, but only two are important Contrast ratio and response time, the time taken between the result on screen and when the button is pressed. This is how I decided and its been six months no problems. Till then there are new models but you can use the same approach to decide about a LCD.

Words for Sounds and Expressions - Hindi Comics

I build up this knowledge during my childhood and I found it very funny and hilarious when I visualize and use them today. Here are a few examples: Chapaak - Sound of falling into water Dhadaak - Sound of being hit by a wooden material, chair etc which broke after you are hit. Dharram - Person falling into some wooden or steel material. Dhaaen - Sound of firing of Gun. Bu. Hu. hu.. hu... - Weeping Subak.. Subak - Sobbing Sarraaat - Motar bike moving. Gulup.. Gulup.. - Drowing in water Dhamaka - Blast, they will just make some clouds and right "Dhamaka" in middle. Sudok.. Sudok.. - Having some liquid with a straw And finally a big fight between two people: Make clouds and write on all directions following words - Mukka, Laat, Thappad, Ghussa. And if the person is being severly beaten write in middle "Dhunae par Dhunae". Hope this is going to remind you of childhood. If I have missed some of them, please let me know.

Old Honda City - Value for Money

I am crazy about cars, I was always a fan of old honda city ever since it was launched. Finally I owned it, got it in 2004, 40K done and I am so satissfied with the ride, handling and comfort I enjoy driving this car. My hometown is in Jammu and twice I have been there in my old honda city. First time I drove it on my own upto Jammu and was so glad with the comfort and fun I had all the way to my hometown. Second time, I hired a driver who drove me to Jammu and then I got the feeling of comfort and luxury that old honda city can provide on back seat. Six months back I went to a marriage, a friend of mine has recently purchased a brand new zen, he asked me for a test drive to know why I didnt purchased a new car, reluctantly I gave him keys, we went for a drive of 2 Kms and when he handed me back the keys, he said "Get me one like this, or give your city to me and take away my new zen and tell me how much more you want". What a compliment man !! But, the compliments keep pouri...