Pages Navigation Menu

Coding is much easier than you think

Ajax in Java

AJAX implementation in Servlets using JQuery and JSON

Posted by in Ajax, J2EE, jQuery, Servlet | 15 comments

  In my previous post, I explained about making AJAX calls to a servlet from a JSP page and updating a part of the JSP page with a simple response from the Servlet . In this post I am going to add something more to it by making the servlet return complex Java Objects such as lists, maps, etc with the help of JSON in addition to JQuery and AJAX.   Here I’m going to use a JSON library in Servlet to convert this complex Java objects (lists,maps,arrays.etc) to JSON strings that will be parsed by JQuery in the JSP page and will be...

read more

Setting up jQuery jTable plugin in Servlets and JSP

Posted by in J2EE, Java, jQuery, jTable | 3 comments

  In this article we will learn to setup jTable and dependent libraries in a Java web application.     For all who do not know what exactly jTable is, it is a jQuery plugin which is used to create AJAX based CRUD tables without coding HTML or Javascript.   Let us take a look at what happens if we are not using a Jquery Plugin for front end Table data management. Using Java & Javascript: Pre-requisites for usage: Must be a expertise in java & javascript A lot of time on hand Last but not the least...

read more

Gridview in Servlets using jQuery DataTables plugin

Posted by in Ajax, J2EE, jQuery, Servlet | 3 comments

  In this article we shall learn the basic coding that required to create JQuery DataTable using JSON passed by servlet. DataTable is a jQuery plugin which adds a lot of functionality to plain HTML tables, such as filtering, paging sorting, changing page length, server side processing etc.     Library required DataTable Plugin Google Gson jQuery UI themes   Installation   Above download will provide two JQuery plugin jquery.js and jquery.dataTables.js <script...

read more

AJAX in Servlet & jsp using JQuery – Java web application

Posted by in J2EE, Java, jQuery | 4 comments

    Implementing Ajax features in a Java web application will be so easy if you are using JQuery library; Since this library provides built-in methods that can be used to enable Ajax. In this post, I am going to demonstrate the JQuery’s Ajax capability using on blur event in java web application.   Folder Structure     As highlighted in the image download the jQuery library and place in js folder of eclipse work-space, and refer this jQuery files in the head section in the jsp, this jQuery file is responsible...

read more

Setting up jQuery jTable plugin in Struts 2 framework

Posted by in jQuery, jTable, Struts 2 Tutorial, Struts-2 | 34 comments

  In this article we will learn to setup jTable and dependent libraries in Struts 2 web application. jTable is a jQuery plugin which is used to create AJAX based CRUD tables without coding HTML or Javascript, to know more about jTable please refer the article here   Steps done to set up our application for jTable   Libraries required for the setup, jQuery jQuery UI jTable struts2-json-plugin-2.x.x.jar Commonly required Struts 2 jars   Now to start with demonstration of above topic, let us Create a Dynamic Web Project in...

read more

Pie Chart using YUI3 jquery chart plugin in Java web application

Posted by in Ajax, J2EE, Java, Servlet | 1 comment

  In this article we will learn to create a pie chart in Servlet with YUI3 jquery chart plugin and this demo is as follows     YUI3 provides a “charts” module for creating a wide variety of good looking charts, this module can be called using use() method. These charts requires input data to be in JSON format. For more Information on YUI3 chart, read on its official document – http://yuilibrary.com/yui/docs/charts/   Recommended reading Create Auto-Refreshing Pie Chart/Bar Chart in Servlet dynamically...

read more

AJAX File Upload in Java Web Application using jQuery.AjaxFileUpload plugin

Posted by in Ajax, J2EE, jQuery, Servlet | 2 comments

    In my previous article on File Upload Example in Servlet & Jsp we learnt how to upload a file into sever via Apache Commons FileUpload plugin, In this article we shall add ajax style feature to our previous example using jQuery.AjaxFileUpload.js plugin.   Modifications   Before getting into the tutorial, I will let you know the small modification which I made in jQuery Form Plugin.   1. By default this plugin allows only images, this is specified in jQuery.AjaxFileUpload.js as below. valid_extensions :...

read more