Category Archives: Web

Spring MVC Web with Google NoSQL Datastore on GAE Cloud

The article represents key aspects of integrating your Spring MVC web application with Google NoSQL Datastore while working on Google App Engine cloud computing platform. Additionally, it presents code samples for you to get started in a quick manner. You may access the sample application talked about in this article on this page, Welcome to GAE World! Following has been discussed: High-level architecture & design Setup NoSQL Data Model (NoSQL data entity vis-a-vis Google Datastore) Implementation including code samples such as following: Controller (HelloController) JSP (hello.jsp) DAOs (GoogleDSCommentDAO) High-level Architecture & Design Following are key technologies used for the implementation discussed in this article: Spring MVC Google Datastore (NoSQL Database) …

Continue reading

Posted in Cloud, Java. Tagged with , .

5 Steps to Get Spring MVC Web Application on Google App Engine

The article represents steps on what you need to do to get your first Spring MVC Hello World web application project on Google App Engine (GAE). As a pre-requisite, we recommend you to check our earlier article on How to get started with Google App Engine. The article would help you to quickly get your started with GAE based web development using Eclipse IDE. We shall work  with our existing Non Spring MVC project (check this page) and convert it into Spring MVC based web application. Step 1: Spring MVC Libraries Get Spring MVC libraries within folder (war/WEB-INF/lib). Also, do not forget to get following two runtime dependent libraries: commons-logging-1.1.3.jar …

Continue reading

Posted in Java. Tagged with .

How to Get Started with Google App Engine Java Project

hello world code samples

The article presents quick tips to get started with your next Java Web Application on Google App Engine (GAE). I was able to create my first web application on Cloud (GAE) named as “The Coders Shop”,  in couple of hours, however, with little hiccups which I have mentioned in this article. Pre-requisites Following are pre-requisites to get started quickly: Create a Google account. This would be used to create an App Engine Id that would represent your web application on the web. For an app engine id, xyz, the web URL of your application will be xyz.appspot.com. You could alternatively create App Engine Id right from within Eclipse shown below. …

Continue reading

Posted in Java. Tagged with .

Java Functional Interface Explained with Code Samples

The article aims to describe functional interface in Java 8 with the help of hello world code samples. What is Functional Interface? Simply speaking, a functional interface is the plain old Java interface with JUST ONE and ONLY ONE abstract method also termed as the functional method. However, that does not stop functional interface to not contain default and static methods. Following is an example of a functional interface: @FunctionalInterface public interface HelloInterface { // Abstract method void sayHello( String name ); // Static method static void sayThanks() { System.out.println( “Thank You!” ); } // Default method default void sayHelloWorld() { System.out.println( “Hello World!” ); } } Observations: In the …

Continue reading

Posted in Java. Tagged with .

What does Interface in Java 8 Look Like?

Before we go into looking at different aspects of interface in Java 8, lets look at some of the definitions found on some of the source-of-truth websites that seem to contradict the definition of Interface in Java by defining it with a generic definition despite the fact that interface got evolved (such as below 🙂 and has got a new definition in Java 8. Whether or not, the evolved interface in Java 8 is a good move, is beyond the scope of this article. However, please feel free to share your comments. Lets look at some of the following definitions of a Java interface I took from the web at the time of …

Continue reading

Posted in Java. Tagged with .

Java 8 Lambda Expressions Examples using Calculator Implementation

lambda expressions examples

The article demonstrates the Lambda expressions using Calculator (interface) code samples. It also makes use of Functional interfaces from java.util.function package to demonstrate Calculator implementation using BiFunction and BinaryOperator interfaces. Calculator Implementation Demonstrating Lambda Expressions The Calculator methods implementation would be explained using both, traditional approach and the approach making use of Lambda expressions. Traditional Approach Using traditional approach, many would have gone implementing Calculator add, substract, multiply and divide function based on following: Define a Calculator interface with four methods namely add, subtract, multiply and divide; Another approach could be to create a single method with an operation flag and provide conditional implementation based on flag. Create a CalculatorImpl …

Continue reading

Posted in Java. Tagged with .

Gradle War Configuration for Eclipse Spring Web Application Project

The article describes the configuration one would need to create WAR file for an Eclipse-base web application (Dynamic Web) project. Below code represents whats needed to compile your Java Eclipse-based web application project and create WAR file which can be deployed later, on any Java server such as Tomcat. Pay attention to some of the following facts: repositories: “repositories” is referred in a local directory rather than external repository such as MavenCentral etc. sourceSets: sourceSets define the path under which Java source code exists. It MUST BE NOTED that failing to define this would have Gradle look into Maven-based folder such as “src/main/java” for source code that would eventually result …

Continue reading

Posted in Java, Web. Tagged with , , .

Web Application Folder Structure for Spring MVC Web Projects

Dynamic Web Project Folder Structure

The article lists down two most commonly used folder structure for a Spring MVC/Hibernate based web application project. In fact, this folder structure could be used with any other MVC framework like Spring. Following are different two folder structures described later in this article: Eclipse-based Web Application (Dynamic Web Project) Maven-based Web Application Project Eclipse-based Web Application (Dynamic Web Project) As per this Eclipse page, Dynamic web projects contain dynamic Java EE resources such as servlets, JSP files, filters, and associated metadata, in addition to static resources such as images and HTML files. Following is how the folder structure looks like on the disk: src packages (com.orgid.abc) WebContent CSS/JS Folders (Publicly …

Continue reading

Posted in Web. Tagged with .

Steps to Get Started with Spring MVC 4 & Hibernate 4

The article lists down steps one need to take in order to get up and running with Spring MVC 4 and Hibernate 4. The article will describe following three key aspects: General configurations to setup Java, Eclipse and Tomcat Server Spring MVC 4 configurations & code samples Hibernate 4 configurations & code samples Following are key components/artifacts that would be required to create the web application which makes use of Spring MVC 4 for managing MVC and Hibernate as an ORM framework: Libraries & Tools Configuration files Components Controller Views (JSP pages) Business logic classes Data access classes Key Libraries & Tools Following are key libraries and tools to download …

Continue reading

Posted in Java. Tagged with .

Top Bookmarks – How to Get Started with Spring MVC & Eclipse

Spring MVC Lifecycle

The article lists down top bookmarks (pages) which helped me to quickly get started with Spring MVC with Eclipse. Also, presents some key information at a very high level. Spring MVC Framework Tutorial Spring MVC Form Handling Example  Spring MVC Hello World Example  Spring 3 MVC Hello World Example Spring 4 MVC Hello World Tutorial – Full Example  Following are high level steps to get started with your first Spring MVC project using Eclipse: Download Java EE eclipse and configure server for ease of deployment from within Eclipse. Create a Dynamic Web Project in Eclipse. Drag and drop below mentioned Spring and other libraries into the folder WebContent/WEB-INF/lib. One of …

Continue reading

Posted in Java. Tagged with , .

How to Add Tomcat 8 to Eclipse Kepler

The article represents steps required to configure Tomcat 8 with Eclipse Kepler. Download Tomcat 8 and place it within any local folder. Download Eclipse Java EE Kepler As of date, Tomcat 8 is not supported in Eclipse JaveEE Kepler. However, you could add the Tomcat 8 by doing following: Go to the WTP downloads page, select the latest version (currently 3.6), and download the zip. Here’s the current link. Copy the all of the files in features and plugins directories of the downloaded WTP into the corresponding Eclipse directories in your Eclipse folder (overwriting the existing files). Start Eclipse and click on “Servers” tab in the workbench. Go ahead and …

Continue reading

Posted in Java. Tagged with .

How to Get Started with Bootstrap (UI) & Eclipse

The article represents steps required to get started with Bootstrap (UI) with Eclipse IDE while working with a dynamic web project involving JSP, Servlets etc. Even before we go ahead, you may be wondering on why should you care about adding bootstrap to Eclipse. Why BootStrap? The interesting thing about bootstrap is that it helps you to get started as quickly as possible with cool looking UIs that can be created out-of-box HTML/CSS code snippets. As a matter of fact of fact, I landed up with Bootstrap after I was searching for some rapid Java UI builder for Eclipse using which I could easily build fancy UIs while focusing on …

Continue reading

Posted in Web. Tagged with .

Tea-Time Java Quiz #1

Interview questions

Tea-Time Java Quiz is intended to be quick 5 questions Java quiz which one could quickly take from time-to-time to test their Java knowledge on the ongoing basis. [WpProQuiz 2]

Posted in Java. Tagged with .

List of Javascript Templating Engines & Why One Needs Them?

The article presents a short overview on why one needs Javascript templating engines and, a list of these frameworks. Please feel free to suggest one or more frameworks if I missed to include them in the list below.   Why do I ever need Javascript templating engine? Consider the following use-case scenario. Let’s say, you are a big enterprise with different line of businesses (LOBs). Each LOB has a set of web applications serving its business needs. With different LOB having different applications, following scenario is likely to happen: One particular LOB, X, has applications written with Java/JSP. Other LOB, Y, has applications written with .NET technology Other LOB, Z, …

Continue reading

Posted in Javascript, Web. Tagged with .

Javascript Frameworks used in LinkedIn.com

The article lists down different Javascript frameworks that have been used in LinkedIn web UI and mobile app. Following are some of the key Javascript frameworks that have been used in various different LinkedIn applications (Web & Mobile). If you disagree with one or more of these frameworks, please shout out loud. Also, feel free to suggest of frameworks that I missed to include. Sorry for any typos/misspellings as you read further.   Dust.js Dust.js, the client-side templating engine, is used to serve LinkedIn webpages with common UI code for different web-apps products. These web-apps products are created using varied technology stack including Java/Grails/JRuby etc. With Dust.js, LinkedIn moved from …

Continue reading

Posted in Web. Tagged with , .

Java Interview Questions (Part 1) – Rookies Series

The article (first in the series) aims to present some tricky interview Java questions that could help you score high in your next Java interviews:    Programming fundamentals Question: What is difference between object-oriented programming and functional programming? Answer: Following pages present good perspective on the differences: http://stackoverflow.com/questions/6720348/difference-between-oop-and-functional-programming-scheme http://c2.com/cgi/wiki?OoVsFunctional    Java Objects Question: What is difference between comparing two objects using equals method and “==” operator? Answer: http://stackoverflow.com/questions/5848370/equals-and-operator-in-java Question: What is the significance of equals and hash method in Object class? Answer: http://www.javaworld.com/article/2074996/hashcode-and-equals-method-in-java-object—a-pragmatic-concept.html    Collections Question: What is difference between LinkedList and ArrayList? When would you want to use one and not the other? Answer: http://javarevisited.blogspot.in/2012/02/difference-between-linkedlist-vs.html Question: How come you …

Continue reading

Posted in Freshers, Java. Tagged with , .