How to get ServletContext and ServletConfig object in a Spring Bean

Introduction 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.

Username Availability Check Using Servlet, AJAX And MySQL

Check Username Live This tutorial shows how to check username availability using Servlet, AJAX and MySQL. Sometimes you may need to check username availability instantly before a user presses the submit button after filling a long-sized signup form. In this case you can use AJAX with any technologies like PHP, Codeigniter, Servlet, Struts, JSF, Spring etc. for checking whether the…

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….

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….

JSP Servlet Login Logout with Remember Me

Introduction This tutorial, jsp servlet login logout with remember me, will show you how to login to an application with remember me functionality. Sometimes we need to remember username and password for few days or months or years so that next time onwards a user can login without entering the username and password into the input fields. The username and…

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…

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….

Show Warning Message to User When Session Expires

Introduction In this post we will see how to show warning message to user when session expires in a web application. So we will redirect user to login page once session has expired. We know that we let users login to the web application before a user can perform some sensitive activities like online transactions, updating user’s profile etc. So…

Prevent user going back to login page if already logged in using filters

In this article I am going to show you how to prevent user going back to the login page if a user is already logged in or redirect a user to the login page if the user is not already logged in. When browser caches the resources then clicking on the browser’s back button will take a user to the…

Prevent Browser From Caching Resources Using Servlet Filter

Introduction In this tutorial I am going to tell you how you can prevent cache in browser using Servlet in web applications. Sometimes you may need to clear the browser cache or prevent the browser from caching resources so that users always get the latest output from the server. Disabling caching of web pages ensures resources are coming every time…