Username availability check using Servlet, AJAX and MySQL

Sometimes we need to check username availability instantly before a user presses the submit button after filling a long-sized signup form. In this case we can use AJAX with any technologies like PHP, Codeigniter, Servlet, Struts, JSF, Spring etc. for checking whether the input username is avaialable or already occupied by someone else. So if we give instant result to the user for username availability then sometimes it makes more sensible than while pressing the submit button and goes top of the signup form to rectify the username input field if input username is not available.

This tutorial shows how to check username availability using Servlet, AJAX and MySQL. So after finishing this example you will be able to apply the same logic to any Servlet based web framework or any server side technologies such as PHP, Codeigniter etc. Continue reading “Username availability check using Servlet, AJAX and MySQL”

HighChart using AJAX, JSP and Servlet

We know that HighChart basically displays different statistical data on different chart types such as column chart, bar chart, line chart, pie chart etc. You can have a look at the URL http://www.highcharts.com/ for more information.

You can integrate HighChart with any server side technology but here I will show you how to integrate HighChart using AJAX, JSP and Servlet. This tutorial shows step by step so that we can understand how it happens. It displays the data for site visitors log in line chart. I have also put a calendar for date-picker so that you can pick a custom range of dates and get the visitor statistics in HighChart. The calendar has more features like you can select Today, Yesterday, Last One week, Last One month etc. On mouse hover on the line chart you can see the visitors count on a particular date.

Continue reading “HighChart using AJAX, JSP and Servlet”

XChart using AJAX, JSP and Servlet

We know that xchart basically displays different statistical data on different chart types such as column chart, bar chart, line chart, pie chart etc. You can have a look at the URL http://tenxer.github.io/xcharts/ for more information.

You can integrate xchart with any server side technology but here I will show you how to integrate xchart using AJAX, JSP and Servlet. This tutorial shows step by step so that we can understand how it happens. It displays the data for site visitors log in line chart. I have also put a calendar for date-picker so that you can pick a custom range of dates and get the visitor statistics in xchart. The calendar has more features like you can select Today, Yesterday, Last One week, Last One month etc. On mouse hover on the line chart you can see the visitors count on a particular date. Continue reading “XChart using AJAX, JSP and Servlet”

Google Chart using JSP, Servlet

We know that Google chart basically displays different statistical data on different chart types such as column chart, bar chart, line chart, pie chart etc. You can have a look at the URL https://developers.google.com/chart/ for more information.

You can integrate Google chart with any server side technology but here I will show you how to integrate Google chart with JSP, Servlet. This tutorial shows step by step so that we can understand how it happens. It displays the data for area-wise top seven countries in pie chart. You can also use other charts for other purposes. In this example I have used static sample data and the actual data should come from database or other sources. You can change the source of data as per your requirements.

If you have any query please feel free to leave a comment. Continue reading “Google Chart using JSP, Servlet”

Send Any File using SOAP Webservice

This tutorial shows how we can send file using SOAP based webservice. The type of the file can be anything, i.e., text, image, pdf, MS doc etc. For this type of application we need to create two applications – one will work as a client application(which sends a file) and other one will work as a server application(which receives a file). So the server application will deploy the service whereas client application will consume the service. In server application we will have logic for what will be done with the file content after receiving the file. Using the client application we will upload the file and send through the SOAP service.

In this example both client and server applications are web based application. In client application we will upload the file using JSP, Servlet and send it to the server application which then saves the received file to the specific location on disk.

Please feel free to contact me for any kind of help. Continue reading “Send Any File using SOAP Webservice”

Java application and database backup

In the world of web it is important to take backup of our site and database frequently. We don’t know when we’d come accross unexpected error which causes our site stop working. Here I have developed an application in Java, Servlet and JSP which will help you to take backup as per your wish whenever you want to take backup. This application takes backup from your workspace for the current web application. While taking backup it creates zip files in the workspace and you will be given choice whether you want to download or delete once the backup is successfully done. You can select what type of backup you want to take like site, database or site & database together. You can also see the backup files are saved to the physical workspace location of your hard drive.

If you have any query please feel free to send a query in comment section of the article or you can also contact me through Contact page. Continue reading “Java application and database backup”

Prevent browser from caching resources

Sometimes we need to clear the browser cache or prevent the browser from caching resources so that we always get the latest output from the server.

Disabling caching of your webpages ensures your resources come from the server each and every time. In every browser, you’ll find the option to disable caching or even you can clear the cached resources but this type of caching is client side caching and we do not rely on whether users will disable cache or clear cache. Therefore we want to ensure that every time a page is requested will bring the updated content from the server.

Continue reading “Prevent browser from caching resources”

Cache static resources like css, js and images for a specific time period

Static resources like css, js images etc. need not be reloaded from the server every time until and unless we want the old one needs to be replaced by the new one.

Sometimes we need to cache static resources so that performance of the site can be improved over the time.

Cache is defined as hardware or software feature that stores data in temporary storage space that permits quick access to stored data.

Web browsers like Chrome, Firefox, Internet Explorer etc. use the cache for regularly accessed web pages. This feature enables the browser to retrieve data from cache than from web page files.

Continue reading “Cache static resources like css, js and images for a specific time period”