Access Spring context from web application

As I am using JSF with Spring, the beans managed by Spring are not accessible in my page, I used this Siegfried Bolz’s blog as a basis and used the facade pattern to hide access to the context. The Spring context is loaded when the application starts using ContextLoaderListener in the apllication web.xml: <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>… Continue reading Access Spring context from web application

MyBatis+Spring+Generics

As I was working on the data access layer of my project, I noted that I have a lot of stuff to do to be able to access the Mapper from my web layer just for some simple CRUD actions. Lot of stuff and even if I can detect some similarities, it’s not exactly the… Continue reading MyBatis+Spring+Generics

Improve server startup using Informix and MyBatis

Working on a project with an Informix database and using MyBatis as the persistence layer, I noted that the start-up of the server takes a long time (about 2 minutes). It is not really a problem if the performance of the application are good, as you don’t start your server all the day, but when… Continue reading Improve server startup using Informix and MyBatis

JBoss transaction manager (Non XA)

This is my configuration for using the transaction manager implementation provided by JBoss outside of a JEE container. This configuration works for database transaction but not for JMS transaction; The configuration is done with Spring which delegates the transaction management to the JBoss implementation. Even if I used all the stuff to be able to… Continue reading JBoss transaction manager (Non XA)

Simple Spring configuration

Spring configuration for use of a simple transaction manager (non XA). The data source must be defined in a JNDI repository (Tomcat in my case). application.xml: <?xml version=”1.0″ encoding=”UTF-8″?> <beans xmlns=”http://www.springframework.org/schema/beans” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:tx=”http://www.springframework.org/schema/tx” xsi:schemaLocation=”http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd”> <bean id=”entityManagerFactory” class=”org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean”> <property name=”dataSource” ref=”dataSource” /> <property name=”jpaVendorAdapter”> <bean class=”org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter”> <property name=”databasePlatform” value=”org.hibernate.dialect.Oracle10gDialect” /> <property name=”generateDdl” value=”false”… Continue reading Simple Spring configuration