Home » Tag Archives: Spring (page 39)

Tag Archives: Spring

Spring MVC 3 Template and Apache Tiles

spring-interview-questions-answers

An efficient design consideration for any web application is the use of a template engine (or tool), and with Spring’s “pluggable” nature, it is indeed much more easier to integrate template mechanisms such as Apache Tiles. In this simple post, I will give you a brief intro and basics of using Tiles as a Template engine for your Web Application! ...

Read More »

Spring 3.1 Caching and Config

spring-interview-questions-answers

I’ve recently being blogging about Spring 3.1 and its new caching annotations @Cacheable and @CacheEvict. As with all Spring features you need to do a certain amount of setup and, as usual, this is done with Spring’s XML configuration file. In the case of caching, turning on @Cacheable and @CacheEvict couldn’t be simpler as all you need to do is ...

Read More »

“Introduction to Spring” Tutorial Series

spring-interview-questions-answers

Hello all, I am glad to present you this “Introduction to Spring” tutorial series! It is a series of articles originally written by our JCG partner Michal Vrtiak at the vrtoonjava blog. A timesheet management application is gradually created in this series and each tutorial builds on top of the previous one. All main aspects of a web application are ...

Read More »

Spring – Adding AOP support

aspectj-logo

I heard a story about one senior (and quite highly paid) softwaree engineer. He was given task to log every method in every controller in project he was working on. Engineer rewrote all controller methods, so from code like this: @RequestMapping(method = RequestMethod.GET) public String showEmployees(Model model) { List<Employee> employees = employeeDao.list(); model.addAttribute('employees', employees); return 'employees/list'; } he made following ...

Read More »

Spring – Adding Spring MVC – part 2

spring-interview-questions-answers

In the previous part we’ve implemented controllers for managers and employees. Now that we know our way around, we’ll do little (but just little) more complicated stuff – controllers for tasks & timesheets. So let’s start with org.timesheet.web.TaskController. First create a class and this time we will be accessing richer domain, so we’ll need to autowire three DAOS – for ...

Read More »

Spring – Adding Spring MVC – part 1

spring-interview-questions-answers

Welcome to the fourth part of this tutorial. In this part, we will write controllers and views using Spring MVC and think about our REST model. First thing that we must do, is make a web application from what we have so far. We will add web/WEB-INF folder to our project root. Inside WEB-INF create jsp folder. We will put ...

Read More »

Spring – DAO and Service layer

spring-interview-questions-answers

Welcome to the third part of Spring tutorial. In this part, we will continue in writing our Timesheet application and this time we’ll implement DAO layer, business services and write some tests. In the previous part, we’ve defined GenericDao interface that tells us, what operations we will need to perform upon entities. Now we need to provide implementation. We will ...

Read More »

Spring – Persistence layer – writing entities and configuring Hibernate

spring-interview-questions-answers

Welcome to the second part of this tutorial. Don’t freak out when you see how long this article is – I promise you it’s mostly easy POJOs and some generated code. Before we start, we need to update our Maven dependencies, because we will be using Hibernate and Spring now. Add following dependencies to your pom.xml: <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>3.6.8.Final</version> ...

Read More »

Spring – Designing the domain model and the service layer

spring-interview-questions-answers

We are going to build application for timesheet management. So let’s think about some uses cases and entities first. Let me write them in the few bullets: Task is assigned to employee by manager. One task can be assigned to many employees. Employee fills the amount of hours that he worked on certain task to the system. Manager/Employee views reports ...

Read More »

Spring 3.1 Caching and @CacheEvict

spring-interview-questions-answers

My last blog demonstrated the application of Spring 3.1’s @Cacheable annotation that’s used to mark methods whose return values will be stored in a cache. However, @Cacheable is only one of a pair of annotations that the Guys at Spring have devised for caching, the other being @CacheEvict. Like @Cacheable, @CacheEvict has value, key and condition attributes. These work in exactly the same way as those supported by @Cacheable, so for more information on ...

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