How to get ServletContext and ServletConfig object in a Spring Bean

ServletConfig is used by only single servlet to get configuration information, whereas ServletContext is used by multiple objects to get configuration information. ServletConfig object is one per servlet class and destroyed once the servlet execution is completed. ServletConfig object gets created during initialization process of the servlet and this object is public to a particular servlet only.

Continue

Username availability check using Servlet, AJAX and MySQL

Introduction This tutorial shows how to check username availability 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…

Continue

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…

Continue

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…

Continue

Google Chart using JSP, Servlet

Here I am going to show you how to display data on Google Pie Chart using JSP and Servlet. You 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. It displays the data for area-wise top seven countries in…

Continue

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…

Continue

Prevent browser from caching resources

Introduction In this tutorial I am going to tell you how you can prevent cache in browser. 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 web pages ensures your resources are coming every time from the server. In every browser, you’ll find an 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…

Continue