Home » Tag Archives: Spring (page 21)

Tag Archives: Spring

Spring REST: Exception handling vol. 2

spring-interview-questions-answers

This is a second article from the series about REST Exception handling with Spring. In my previous post I have described how to organise the most simple exception handling in a REST service. This time I will go further and I will show you when you’d better to use exception handling on a @ControllerAdvice level. INTRO Before I will start ...

Read More »

Spring Data MongoDB cascade save on DBRef objects

mongodb-logo

Spring Data MongoDB by default does not support cascade operations on referenced objects with @DBRef annotations as reference says: The mapping framework does not handle cascading saves. If you change an Account object that is referenced by a Person object, you must save the Account object separately. Calling save on the Person object will not automatically save the Account objects ...

Read More »

Add Apache Camel and Spring as jboss modules in WildFly

jboss-wildfly-logo

These days I am playing with Wildfly and Apache Camel and Spring. A simple way to communicate between EARs / WARs is using direct-vm component of Camel. There are many ways to achieve this with or without Camel. Camel works like a charm in WildFly without any need for extra configurations. Camel is great!!! In order to avoid pack all ...

Read More »

Auditing Entities in Spring Data MongoDB

mongodb-logo

Spring Data MongoDB 1.2.0 silently introduced new feature: support for basic auditing. Because you will not find too much about it in official reference in this post I will show what benefits does it bring, how to configure Spring for auditing and how to annotate your documents to make them auditable Auditing let you declaratively tell Spring to store: date ...

Read More »

Spring Security – Behind the scenes

Spring-Security-logo

Security tasks such as authentication of user and authorization of a user to view application resources are usually handled by the application server. These tasks can be delegated to Spring security flow relieving application server from handling these tasks. Spring security basically handles these tasks by implementing standard javax.servlet.Filter. For initializing Spring security into your application, you need to declare ...

Read More »

Getting started with Spring Data Solr

apache-solr-logo

Spring Data Solr is an extension to the Spring Data project which aims to simplify the usage of Apache Solr in Spring applications. Please note that this is not an introduction into Spring (Data) or Solr. I assume you have at least some basic understanding of both technologies. Within the following post I will show how you can use Spring ...

Read More »

HOW-TO: Custom error pages in Tomcat with Spring MVC

apache-tomcat-logo

Default Tomcat error pages look scary. In addition, they may expose valuable information including server version and exception stack trace. Servlet specification provides a way to configure an exceptional behavior through web.xml. One can configure either reaction on a specific Java exception or to a selected Http response code(s). error-page element specifies a mapping between an error code or exception ...

Read More »

Strategy Pattern ain’t meant for Spring!

spring-interview-questions-answers

Right, so lets say you’re writing a Spring MVC app and you decide, “I want to do seperate encapsulated algorithms that can be swapped to carry out a specific behaviour”. The classic response to this would be “you need the Strategy Pattern ma’ boy!”.  So, that’s what I did, consider the code below… Interface     public interface MealStrategy { ...

Read More »

Thymeleaf template layouts in Spring MVC application with no extensions

spring-interview-questions-answers

After some years with JSP/JSTL and Apache Tiles I started discovering Thymeleaf for my Spring MVC applications. Thymeleaf is a really great view engine and it simplifies and speeds up the development despite that lack of good IntelliJ (vote here: http://youtrack.jetbrains.com/issue/IDEABKL-6713) support at the moment (there is an Eclipse plugin though). While learning how to use Thymeleaf I investigated different ...

Read More »

Getting Started with method security in Grails using Spring Security

grails-logo

This blog post will be about implementing method level security with security expressions in Grails using the Spring Security plugins. I assume you have some basic understanding of the Grails Spring Security Core plugin. Roles aren’t enough. When using the Spring Security Core plugin you typically start to configure which roles are required for accessing certain URLs. This configuration can ...

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