SPRING Articles

Injecting Dependencies with Spring

Dependency Injection is a software design pattern that can make the source code significantly simple, easy to understand, maintain and test.

View Article

Wiring Spring Beans

All the objects in a Spring based application are created and managed in the Spring container. After beans are created they are wired together so that they can interact with each other.

View Article

Automatic Bean Wiring in Spring

Spring can be configured to discover the beans and inject dependencies into them automatically, reducing the tedious task of defining each and every spring bean we use in a spring based application.

View Article

Addressing Ambiguity in Spring Autowiring

Spring autowiring is powerful concept, but we should be very cautious while using it. We may end up in creating ambiguity while autowiring beans, which will cause autowiring to fail.

View Article

Creating Conditional Beans in Spring

The concept of condition beans enables Spring to restrict the creation of any bean depending on the evaluation of a condition. These beans get created only when a preset condition is evaluated as true

View Article

Switching Database Profile using Spring Profiles

We are most likely to have separate db configuration for different environment like development and production environment. Spring profiles provide a convenient way to switch db profiles at runtime.

View Article

AOP with Spring

Spring support for AOP helps developers to separate cross cutting concerns from the business logic, thus making the source code clean and maintainable. This article talks about Spring's AOP support.

View Article

Spring MVC Overview

Spring MVC is a popular framework which provides MVC architecture for Java developers to build Spring-based web application. This article describes the request flow and other preliminary topics of...

View Article

Spring MVC Sample Application Using XML Config

This article helps in getting started with Spring MVC with the help of a simple hello world example. We show the steps to create a sample application and describe its essential required components.

View Article

Spring MVC Sample Application Using Java Config

With the advances in Servlet and Spring technology developer can also configure Spring using Java classes rather than the traditional approach of using XML files. This article demonstrate Java confi..

View Article

Adding Additional Servlets and Filters to Spring MVC Application

A Javaconfig based Spring MVC Application doesn’t need a deployment descriptor file (web.xml). How do we register additional servlets or filters?

View Article

Accepting Request Param and Path Variable in Spring Controller

Spring MVC provides various ways through which a client browser can pass data to the Controller. In this article we will discuss about accepting Request Parameters and Path Variables in Spring Contr..

View Article

Handling Form Data In Spring MVC Controller

Spring MVC Controllers are very well suited for the form processing jobs. This article discuss about handling forms in Spring MVC

View Article

Spring Form Validation

Spring's support for Java Validation API provides an excellent way to validate form data posted by the user. This article covers the details of validating form data and handling validation errors in..

View Article

Spring Custom Form Validator

Learn how to create a custom form validator in Spring MVC application with the help of a simple example.

View Article

File Upload in Spring MVC Application

Any typical web application requires a file upload functionality. This article explores Spring's support for file upload.

View Article

Spring Transaction Propagation

Spring provides different propagation levels to manage propagation of trasaction between different Spring beans. This article will be focused on different propagation level available in Spring Transac

View Article

Exception Handling in Spring Application

This article describes different ways of handling exceptions and translating those exceptions to HTTP response codes in a Spring application.

View Article

Advising Controllers in Spring Application

Sometimes we might want a certain aspect of a contoller to be applicable to all the controllers in the application. @ControllerAdvice is helpful in such cases.

View Article


JUNIT Articles

Unit Testing with JUnit

JUnit is a popular unit testing framework that helps developers to unit test their source code during the development of a java application. This articles demonstrates a basic JUnit Test Case.

View Article

Testing with Multiple Inputs using Parameterized Runner

JUnit Parameterized Test Runners provides the abiltiy to run the same test over and over again using different set of inputs.

View Article

Understanding JUnit Test Suite

A JUnit Test Suite allows developers to bundle multiple test classes together into a single unit (called as test suite) and run them all together at once.

View Article

Grouping Of Tests using JUnit Categories

JUnit provides the developers with an opportunity to group multiple tests into a single category, thus creating the possibility to include or exclude the category during execution of the test case.

View Article

Testing Exception and Timeout with JUnit

Apart from testing positive scenarios, JUnit can also be used to test negative scenarios. It can be used to test scenarios where an exception is expected or a timeout is to be checked.

View Article

Introducing JUnit Rule

Junit Rules allows developers to add additional functionalities that can applied to all test methods in a test class. It is similar to the concept of custom test runners but with reduced restrictions.

View Article


LOG4J Articles

Introduction to Logging with Log4J

Log4j is an open-source logging framework that helps developers to capture logging statements in java applications. It is fully configurable and can be configured using external configuration files.

View Article

Logging Different Priority Level Messages to Separate Files

Log4j can be configured to publish different priority level messages in separate files; developers can log error messages in a separate file thus reducing the effort of searching errors in large files

View Article

Integrating Log4J with Perf4J for Performance Logging

Perf4j is an open source logging framework used primarily for monitoring performance statistics in java applications. Log4j has the ability to integrate with perf4j to capture performance data.

View Article

Using Slf4J Facade with Log4j

Slf4j is a high level logging framework. Its serves as a facade and the actual logging is performed by the underlying logging framework which can be determined at runtime.

View Article