Simple web MVC with servlets and JSP

August 5, 2012 by Vinicius Isola

A while ago a friend of mine that is starting with web development in Java asked me what is the best way to write a web application in Java if you can’t understand a framework like Spring or JSF or if you just don’t want to use them? Well, this project is a simple example on how to get a MVC working with a database using a singleton that will generate a data source for you.

OSGi Maven and Servlet

July 31, 2012 by Vinicius Isola

I tried a few times before to start developing using OSGi but never had a chance to work with it in the real life so it’s hard to get all the concepts to stick in my head. This post is my way to change that, meaning that I’m trying to learn OSGi deeper and start getting things done using this platform. The first thing I wanted to do is to have a good experience with tooling and get Maven to work for me, not against me.

Simple Caching with Spring

July 22, 2012 by Vinicius Isola

This week an old friend contacted me because he was having memory problems in one of his applications. The problem was very simple: for each user logged in, all application menus and part of the list/combo values were being added to the user session (including some images). That was used to makes things faster, to avoid going to the database multiple times and loading the data all over again.

Customizing Spring Security

July 20, 2012 by Vinicius Isola

Spring Security is a very powerful and customizable security framework for JEE applications. This post will show how to integrate it seamlessly with your application setting up a custom login and logout. You’ll also learn how to add a custom filter with very specific behavior and how to integrate with Spring Data so that your users can be loaded from a repository and avoid all the hassle of dealing with JDBC or Hibernate.

Beginning with Maven and M2

June 3, 2012 by Vinicius Isola

Apache Maven, in my opinion, is one of the most controversial tools around. From my experience, there are three kinds of developers today: those that never heard about Maven, those that hate it and those that can’t live without it. For a long time I was in the second group and I just recently turned to the third one, and I’m slowly dragging all my fellow programmers with me!

Bean Validation (JSR-303) and Spring MVC

April 14, 2012 by Vinicius Isola

The code for this example can be found at the blog repository in github. Validation in web applications normally spread through many lines of code in the client side and in the server side. JSR-303, or Bean Validation, is a standard developed to be part of JPA. It’s a simple and generic way to annotate your entities with specific validation rules and have them validated by some validation engine.

What is and how to use @ModelAttribute

April 11, 2012 by Vinicius Isola

You can get the code for this post in the blog repository in github. Spring MVC is one of the easiest and most powerful MVC framework to build web applications in Java. With all the features that it has available it is impossible to know everything. But in most cases, when you ask the question: “Can Spring MVC do [put something complex and unexpected here]?” the answer is yes. And when it can’t, the answer is: it has a place for you to hook your code in and do whatever you need.

Simple Spring Data Example

March 26, 2012 by Vinicius Isola

As my first post I’m going to do a very simple command line application that manages one entity called Person. The purpose of this example is to demonstrate how powerful the new Spring Data projects family are. Spring Data Spring Data is a family of projects that aims to create a repository layer. The idea is to have an abstract layer were all the dependencies will point to and different implementations with all kinds of data repositories (SQL and NoSQL), similiar to what JDBC did for SQL databases.