Welcome

Spring ve Tapestry’de IoC Yaklaşımları 2

İlk bölümde Spring ve Tapestry Framework’lerini IoC container oluşturma kabiliyetleri ve bağımlılıkların enjekte edilmesi konuları üzerinde durmuştuk. Bu bölümde ise kaldığımız yerden bean’ların scope yönetimi ile devam edelim. Scope Yönetimi Tapestry’de varsayılan olarak servisler’in scope’u Spring’de de olduğu gibi Singleton olarak belirlenmektedir. Yani servis için tek bir instance yaratılmakta ve tüm threadler bu instance’i kullanmaktadır. […]

Another Difference Between Autowire byType and constructor

Lets keep playing with autowiring behaviour of Spring Framework. Autowire byType or byName is not required by default. In other words, they will do nothing if they cannot find suitable candidates to inject into target beans. They can be made required in two different ways; One is to use @Required annotation in setter method if […]

Weird Autowiring Behaviour in Spring Framework

During lab sessions in our Enterprise Java trainings I usually leave the main track of lab outlines and start trying various cases related with the topic. It is a bit risky for me but it also becomes beneficial for attendees in terms of learning by experimenting with the framework. The risky point is that I […]

TransactionTemplate and Rollback Rules

When I was playing with TransactionTemplate during one of my Spring training sessions, I promptly suggested audience with trying to change default rollback rules while using TransactionTemplate. After all TransactionTemplate encapsulates boilerplate transaction begin, commit/rollback statements and we only give business logic part which it executes inside that begin…commit/rollback block. Because of this, I’ve thought […]

StringHttpMessageConverter DEFAULT_CHARSET Limitation for Turkish Content

Spring has its own REST support known as Spring Web MVC. Although, I am happy with its general capabilities, I came up with a small but very annoying problem or let’s say limitation related with its one of HttpMessageConverter‘s classes. Spring Web MVC make use of HttpMessageConverter classes both on server and client to handle […]

Sorting Your Beans With Spring OrderComparator

Sometimes you may need to execute your collection of beans in a a specified order. For example, in one of our projects, we have collection of EventHandlers which operate on when certain Events occur. For each event there might be more than one EventHandler instance that need to operate on. Most of the time it […]

Reassociated object has dirty collection reference

This is something really weird Hibernate error you may come up in several situations. When I first googled around, I found some sites commenting the source of error as “trying to attach a transient entity with the session, or entity with a collection not in type of PersistentCollection etc.” However, none of those cases maches […]

Allowing roles without defining them in intercept-url element

Spring Security Framework has lots of authentication and authorization features, and almost all of them can be customized and extended according to your own needs. One of the common requests I come up with is that developers don’t want to explicitly define roles which have administrative priviledges in intercept-url elements like below; <intercept-url pattern=”/secured/*” access=”ROLE_ADMINISTRATOR,ROLE_USER,ROLE_EDITOR”/> […]

Reusing Persistent Token Mechanism of Spring Security

Spring Security Framework exists in my enterprise application development tool suite for ages. Over years it has evolved a lot and become a much more reusable and extendable framework for various security needs. Recently, one of my clients came up with an interesting requirement. They are developing a mobile client for their enterprise web application, […]

Spring Way of Implementing Abstract Factory Pattern

In my current work, I am responsible for developing a platform to ease web application development using several JEE technologies such as JSF, SWF, Spring, and JPA/Hibernate or Toplink. One main consideration of our management is to keep platform as flexible as possible in terms of which ORM tool is used. Every web application that […]