Categories
Search
My Tweets
Error: Twitter did not respond. Please wait a few minutes and refresh this page.
Tag Archives: spring framework
Database Configuration with Spring 3.2 Environment Profiles
Database Configuration with Spring 3.2 Environment Profiles This is a followup to my previous blog Spring 3.1 Environment Profiles Let’s demonstrate how to configure an application to use different databases based on configuration. The code below is using Spring JavaConfig, … Continue reading
Posted in Annotations, Java, JUnit, Spring, Spring Data, Testing
Tagged apache derby, autowired, dependency injection, derby, di, Environment, h2, h2 database, h2database, Hibernate, hsql, JPA, junit, mysql, oracle, ORM, postgres, postgresql, profile, Profiles, Spring, spring 3.2, Spring Data, Spring Data JPA, spring framework, Testing, unit testing
1 Comment
Enterprise Spring Framework Best Practices – Part 3 – XML Config
Enterprise Spring Best Practices Series In part 3, Spring XML Configuration. The best thing about Spring is that there are several way to solve a problem, the worst thing about Spring is that there are several ways to solve a … Continue reading
Posted in Java Util Logging, SLF4J, Spring
Tagged best practices, java util logging, slf4j, Spring, spring framework, System.err, System.out, xml configuration
5 Comments
Spring 3.1 Constructor Namespace
Spring Namespaces Spring provides several namespaces to simplify XML configuration, such as jdbc, tx, aop, etc. We Spring developers are already familiar with the required beans namespace. <beans> <bean id=”dataSource” class=”…”/> <bean id=”messagingProvider” class=”…”/> </beans> Spring Namespaces are defined at … Continue reading
Posted in Spring, Spring Framework
Tagged constructor, namespace, Spring, spring 3.1, spring framework
Leave a comment
Spring 3.1 Environment Profiles
Spring 3.1 Environment Profiles Profiles Spring 3.1 now includes support for the long awaited environment aware feature called profiles. Now we can activate profiles in our application, which allows us to define beans by deployment regions, such as “dev”, “qa”, … Continue reading
Posted in JUnit, Spring, Spring Framework, Testing
Tagged junit, Profiles, Spring, spring 3.1, spring framework, Testing
3 Comments
What is in my Cloud Environment?
I put together Java sample applications using Spring 3.1. Using Spring’s Environment abstractions, we can gather details about the underlying platform. See the following sample pages Jelastic: http://petclinic.jelastic.servint.net/clinic/environment Heroku: http://evening-window-9861.herokuapp.com/environment CloudBees: http://roobees.gdickens.cloudbees.net/environment Environment Bean package com.gordondickens.roobees.util; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.ReflectionToStringBuilder; … Continue reading
Posted in Cloud, CloudBees, Heroku, Jelastic, Spring, Spring Roo
Tagged cloud, CloudBees, Environment, Heroku, jelastic, spring framework, Spring Roo, springframework
Leave a comment
Simpler JPA with Spring Data-JPA
How to configure your Spring application with Simple CRUD configuration with Spring Data-JPA. 1. Add Spring Data-JPA to project configuration. In your Maven pom.xml file <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-jpa</artifactId> <version>1.2.0.RELEASE</version> </dependency> 2. Configure JPA Entity … @Entity public class Product { … Continue reading
Posted in Hibernate, JPA, Spring, Spring Data, Spring Framework
Tagged Hibernate, JPA, ORM, Persistence, Spring Data, spring framework, SpringData
12 Comments
Annotation Reference for Spring Projects
Annotations are available for Spring and Java projects. I was unsuccessful in finding a single consolidated set of the annotations. So, I thought “What a great gap to fill.” However, what I thought would be a fairly simple endeavor, turned … Continue reading
Posted in Annotations, AOP, Hibernate, Java, JMX, JPA, JUnit, REST, SOAP, Spring, Spring AOP, Spring Batch, Spring Framework, Spring Integration, Spring MVC, Spring Roo, Spring Security, Web Flow, Web Services
Tagged Annotations, Java, JSR-168, JSR-220, JSR-222, JSR-224, JSR-250, JSR-299, jsr-303, JSR-314, JSR-317, JSR-318, JSR-330, Spring, spring framework
9 Comments
Spring Expression Language (SpEL) Predefined Variables
Spring 3.0 introduced Spring Expression Language (SpEL). There are two variables that you have available “systemProperties” and “systemEnvironment“. SpEL allows us to access information from our beans and system beans information at runtime (late binding). These can be applied to … Continue reading
Posted in SpEL, Spring, Spring Framework
Tagged bean variables, configuration, default, expressions, jsr-303, jsr303, spel, spring framework
2 Comments
Using Default Values for Properties in Spring
Defaults for Property Values? I didn’t know that? I was looking through the Spring Greenhouse application and discovered an existing feature that I was unaware of. We can set a default value when configuring PropertyPlaceholderConfigurer. 1. Set the default value … Continue reading
Posted in Roo, Spring, Spring Framework
Tagged defaults, properties, Spring, spring framework
5 Comments