Home » Tag Archives: Spring (page 35)

Tag Archives: Spring

Spring 3.1 – Loading Properties For XML Configuration From Database

spring-interview-questions-answers

Spring makes it easy to inject values obtained from properties files via its PropertyPlaceholderConfigurer and (pre-Spring 3.1) PropertySourcesPlaceholderConfigurer (Spring 3.1). These classes implement the BeanFactoryPostProcessor interface, which enables them to manipulate the values within the Spring XML configuration file before the beans are initialized. So if you specify ${jdbc.driverClassName} to be set to the property ‘driverClassName’, this variable will be ...

Read More »

Spring MVC Error Handling Example

spring-interview-questions-answers

This post describes the different techniques to perform error handling in Spring MVC 3. The code is available on GitHub in the Spring-MVC-Error-Handling directory. It is based on the Spring MVC With Annotations examples. Handling Exceptions Before Spring 3 Before Spring 3, exceptions were handled with HandlerExceptionResolvers. This interface defines a single method:       ModelAndView resolveException( HttpServletRequest request, HttpServletResponse response, Object ...

Read More »

Coherence Event Processing by using Map Trigger Feature

oracle-coherence-logo

This article shows how to process Coherence events by using Map Triggers. Basically, Distributed Data Management in Oracle Coherence is suggested to look over basic configuration and implementation of Oracle Coherence API Map Triggers are one of the most important features of Oracle Coherence to provide a highly customized cache management system. MapTrigger represents a functional agent that allows to ...

Read More »

Spring: Setting Logging Dependencies

spring-interview-questions-answers

This post describes how to set-up logging dependencies in Spring. It is based on information available in a post by Dave Syer’s. A reminder on Java logging frameworks is available here. The code example is available at GitHub in the Spring-Logging-Dependencies directory. Spring uses Jakarta Commons Logging API (JCL). Unfortunately, many people do not like its runtime discovery algorithm. We can disactivate it and ...

Read More »

Method Parameter Names and Spring

spring-interview-questions-answers

Continuing on the previous blog entry about Constructor and method parameters and Java not retaining the parameter names at runtime – the previous entry was about constructor not retaining the parameter names and the implication of this for Contructor injections in Spring, here I will cover a few more scenarios where parameter names not being retained has implications with Spring: 1. ...

Read More »

Spring MVC Form Validation (With Annotations)

spring-interview-questions-answers

This post provides a simple example of a HTML form validation. It is based on the Spring MVC With Annotations example. The code is available on GitHub in the Spring-MVC-Form-Validation directory. Data For this example we will use a bean and JSR303 validation annotations:               public class MyUser { @NotNull @Size(min=1,max=20) private String name; @Min(0) @Max(120) private int ...

Read More »

Spring Constructor Injection and Argument names

spring-interview-questions-answers

At runtime, java classes do not retain the name of the constructor or method parameters, unless classes are compiled with debug options on. This has some interesting implications for Spring Constructor Injection. Consider the following simple class         package dbg; public class Person { private final String first; private final String last; private final Address address; public ...

Read More »

Spring MVC for Atom Feeds

spring-interview-questions-answers

How to add feeds (Atom) to your web application with just two classes? How about Spring MVC? Here are my assumptions: you are using Spring framework you have some entity, say “News”, that you want to publish in your feeds your ‘News’ entity has creationDate, title, and shortDescription you have some repository/dao, say ‘NewsRepository’, that will return the news from ...

Read More »

Clean code with aspects

aspectj-logo

In my previous post I’ve described the alphabet conversion, and I’ve mentioned that we used AspectJ to resolve that task, but i did not mention how AspectJ works and what are aspects generaly. So in the next few lines i will explain: what is Aspect Oriented Programming and why we need it what is AspectJ using AspectJ with Spring (configuring ...

Read More »

Spring MVC Customized User Login Logout Implementation Example

spring-security-logo

This post describes how to implement a customized user access to an Spring MVC web application (login logout). As a prerequisite, readers are advised to read this post which introduces several Spring Security concepts. The code example is available from Github in the Spring-MVC-Login-Logout directory. It is derived from the Spring MVC with annotations example. Customized Authentication Provider In order ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close