Pages Navigation Menu

Coding is much easier than you think

Ajax in Java

How to use JQuery dialog as Confirm dialog?

Posted by in jQuery, jQuery UI

  There are quite a few articles you might have read on SimpleCodeStuffs on jQuery like jQuery Tutorial for Beginners, AJAX implementation in Servlets using jQuery and jQuery UI etc.   This example will help you if you have any one of below queries: How to implement “confirmation” dialog in jQuery UI dialog? How to use jQuery UI dialog as JavaScript confirm BOX? How to use JQuery dialog as Confirm dialog? jQuery UI Replacement for alert() Issue: How many times did you have to code some confirmation logic on your website to...

read more

Struts2 AngularJS integration

Posted by in Ajax, AngularJS, Struts-2 | 5 comments

  In this post, we will learn to implement AJAX calls from a JSP page to a Struts 2 Action class using AngularJS and update the same JSP page back with the Json response from the Struts 2.   Library Required   Since Angular can send and receive only in json format, to handle it you need struts2-json-plugin-2.x.x.jar. This plugin allows you to serialize the Action class attribute which has getter and setter into a JSON object.   How to use?   First of all create a “Dynamic Web Project” in Eclipse and...

read more

AngularJS Interacting with Java Servlet using JSON

Posted by in Ajax, AngularJS, Servlet | 6 comments

  In this post, I am going to demonstrate a simple example on how to make AJAX calls from a JSP page to a Servlet using AngularJS and update the same JSP page back with the JSON response from the Servlet. In other words, this post will give you an overview on how to integrate AngularJS in a Java web applications.   There are many JSON libraries available that can be used to pass AJAX updates between the server and the client. I am going to use google’s gson library in this example.   Below are the steps to reproduce to...

read more

Ajax Cascading DropDownList in JSP & Servlet using JQuery and JSON

Posted by in Ajax, jQuery, Servlet | 5 comments

    There are times in a web application where you want to populate a dropdown list based on the value of another drop down list. In this example, we will be creating a dropdown list for favorite spots and favorite player; since this scenario involves in returning complex java objects like lists, maps, etc, so I’m using JSON for this purpose. In the article on AJAX in Servlet & jsp using JQuery I have demonstrated on returning simple object from servlet to jsp via jquery.   Library required   Google...

read more

Refresh DIV Content Without Reloading Page using jQuery

Posted by in jQuery

  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 the response from the Servlet.   This article will help you to Refresh DIV Content Without Reloading Page using jQuery with simple html page.     Refresh Div without Reloading Page Refresh DIV Content Without Reloading Page using jQuery Demo by Mohaideen - @ SimpleCodeStuffs This div will get refreshed for every 2 seconds..!   Another must read...

read more

AJAX Tooltip in Java Web Application using qTip2 jQuery plugin

Posted by in Ajax, J2EE, jQuery, Servlet

  This article discusses AJAX Tooltip in Java Web Application using qTip2 jQuery plugin. This library is used for creating Asynchronous display of tool tip.   Library required jQuery Library qTip2 Google gson   Project Structure   Now Create a dynamic web project in Eclipse with following folder structure     Set up from browser perspective: jQuery qTip2   Jsp form which ToolTip via ajax   AJAX Tool tip using qTip2 jQuery plugin Qtip2 Demo With Ajax Call Student...

read more

Ajax implementation in Servlet without jQuery plugin

Posted by in Ajax, Servlet

  AJAX is a technique for creating better, faster, and more interactive web applications. With AJAX, your JavaScript can communicate directly with the server, using the JavaScript XMLHttpRequest object. With this object, your JavaScript can transfer data with a web server, without reloading the page.   This post elaborates on how to implement Ajax in Servlet application.   ** UPDATE: Servlet Complete tutorial now available here.   Folder Structure     Jsp Page   Ajax implementation in Servlet without...

read more

jQuery Tutorial for Beginners

Posted by in Ajax, jQuery

  In this article we are going to take a look at introduction to jQuery, what it is, what is does and why we should use in our website.   If you are looking to perform Ajax operations in your website with lot of cool effects on it and you are not completely familiar with java script, then jQuery is a very easy and flexible way to integrate thing like effects, Ajax, animation and so on.   A Little Bit About jQuery   jQuery is Open-Source JavaScript library that contains variety of functions and other functionality that...

read more

Pagination in Struts 2 using jQuery jTable plugin

Posted by in Ajax, jQuery, Struts-2

    This is the third article on jQuery jTable plugin in Struts 2 that describes on how to implement pagination feature to do server side paging in struts 2 using the JQuery jTable plugin and here I have not explained about how to setup jTable plugin in struts 2. So If you have not read my previous articles “Setting up JQuery jTable plugin in Struts 2” and “Ajax based curd operation in Struts 2 using JQuery jTables plugin”, I will recommend that you read that article first because first one explains how you...

read more

AJAX implementation in Struts 2 using JQuery and JSON

Posted by in Ajax, jQuery, Struts-2 | 54 comments

    In this post, we will learn to implement AJAX calls from a JSP page to a Struts 2 Action class using JQuery and update the same JSP page back with the Json response from the Struts 2.   Library required   Since the response to be sent to jQuery is of type JSON, to handle it you need struts2-json-plugin-2.x.x.jar. This plugin allows you to serialize the Action class attribute which has getter and setter into a JSON object.   Steps done to set up our action for JSON   From the browser perspective:...

read more