Browsed by
Month: April 2016

JSP Servlet with AJAX Example

JSP Servlet with AJAX Example

JSP Servlet with AJAX Example Ajax is a great feature implemented almost in all the websites in some way. It gives really a very good user interface, since things are loading/populating without refresh. It is commonly used in username availability checking, register/login page db level/business level validations etc. We are going to use Ajax with JSP and servlet to calculate the EMI payable amount by giving amount, month and interest rate in single screen(without refreshing). Requirements: 1. Include jQuery library…

Read More Read More

635 total views, no views today

EMI Calculator using JSP, Servlet and Bootstrap

EMI Calculator using JSP, Servlet and Bootstrap

EMI Calculator using JSP, Servlet and Bootstrap: Designing a responsive website reduces the startups to invest separately on android and ios apps. Here we are writting a very simple web application for emi calculator using JSP, Servlet and bootstrap. We used bootstrap in this to integrate responsiveness with JSP pages.     Requirement: Download bootstrap CSS and JS files from here. Include the bootstrap css and JS files in the head section, <head> <meta http-equiv=”Content-Type” content=”text/html; charset=ISO-8859-1″> <title>EMI Calculator</title> <link…

Read More Read More

1,421 total views, no views today

Pass values from one jsp to another jsp file

Pass values from one jsp to another jsp file

Pass values from one jsp to another jsp file: Form values from one jsp can be sent to another jsp file with action parameter in form and getParameter method in the second jsp file. Things to remember: Mention the jsp2.jsp file in the form action of jsp1.jsp file. In jsp2.jsp file use getParameter() method and pass the name of the form element inside to get the value whichever is passed from jsp1.jsp file.     jsp1.jsp file: <%@ page language=”java”…

Read More Read More

541 total views, no views today

Clone Shallow copy vs Deep Copy in Java With Examples

Clone Shallow copy vs Deep Copy in Java With Examples

Clone Shallow copy vs Deep Copy in Java With Examples: Clone() method in java used for object duplication. We do not have any method/way other than clone() to make object duplication. Assignment operator(=) will assign the same reference, but it will not duplicate the objects. In java clone() is divided into two types namely shallow copy and deep copy.   Shallow copy: Cloning a new object and copying the same object properties to the cloned object is called as shallow…

Read More Read More

706 total views, no views today

Analyse your site SEO with OnPage.org Focus

Analyse your site SEO with OnPage.org Focus

Analyse¬†your site SEO with OnPage.org Focus: Recently I came across a tool/site named onPage.org Focus for best SEO practises and techniques. They will provide a lot of information’s about your site and important factors need to be considered for best SEO practices.   What is OnPage.org ? OnPage.org is a site/tool which provides a complete details about website’s SEO/optimization and quality details of your website.   Highlights of OnPage.org: Around 160 tools for SEO optimization All type of business websites…

Read More Read More

548 total views, no views today

All Types of Variables in Java

All Types of Variables in Java

All Types of Variables in Java: In Java we have different names for variable types such as class variable, static variable, member variable, block variable, instance variable & local variable. Sometimes we will get the confusion between these variables.   All Types of Variables in Java:   Member Variable Class Variable Static Variable Instance Variable Block Variable Local Variable     Member variables are class variables. Eg: package in.javadomain; public class MemberVariables { // instance variable int instanceMemberVariable; // class…

Read More Read More

497 total views, no views today

Multiple Field Sorting using Comparator

Multiple Field Sorting using Comparator

Multiple Field Sorting using Comparator: Comparator is an interface used to perform custom sorting in java. Comparator can also be used to perform multiple field/sequences sorting in java. Inorder to use comparator to perform custom sorting, We need to create a class with Comparator interface implementation, then we need to override and provide the custom sorting logics in the compare(Object obj1, Object obj2) method. Sample Syntax: package in.javadomain; import java.util.Comparator; public class MyComparator implements Comparator { @Override public int compare(Object…

Read More Read More

469 total views, no views today

All Date Type Conversions in Java with Examples

All Date Type Conversions in Java with Examples

All Date Type Conversions in Java with Examples: This article “All Date Type Conversions in Java with Examples” we are writing to help people to quickly find the data type conversions in java with examples. Few of the below conversions are many times asked in interviews also. So bookmark and read often to store it in your mind.   Array to ArrayList convert in Java Example:   Here we are just iterating the states array and adding it to the…

Read More Read More

547 total views, no views today

Array sorting in Java using Comparator Interface

Array sorting in Java using Comparator Interface

Array sorting in Java using Comparator Interface Array can be sorted in ascending and descending order using, Arrays.sort() method. By Implementing Comparator interface. Find the example array sorting programs below. With Comparator Interface Array sorting Example: ArraySorting.java Java File with integer array and Called ArrayReverseOrder and ArrayAscendingOrder using Comparator implemented classes to perform descending and ascending array sorting respectively. package in.javadomain; import java.util.Arrays; public class ArraySorting { public static void main(String[] args) { Integer[] a = { 3, 5, 1,…

Read More Read More

686 total views, no views today

When to use Comparable interface in Java?

When to use Comparable interface in Java?

When to use Comparable interface in Java? Comparable interfaces in java can be used to perform sorting operations/sort the elements in the collections. It is mainly used for basic level of sortings. You can use comparable interface to perform single sorting sequences.   If you have a model (say Mobile) with around 3 to 5 fields(model, simcount,memory, price) then using comparable you can sort using any one of the field.   Understand clearly: You can sort using simcount/price/model etc…. But…

Read More Read More

562 total views, 1 views today