Archive for the ‘spring’ Category

Clean Desk, Messy Drawer

Monday, October 17th, 2005

My wife, despite all of her loveliness, does have her own ways of annoying me from time to time, one of which being how she cleans up our office desks - she would sweep everything off the surface of the desk and into the two top drawers, shut them close, and claim “Ta-da! See how neat it looks now!” more…

Deploy Spring Sample to Liferay 3.6.1/Tomcat

Wednesday, August 31st, 2005

Just upgraded to Liferay Pro 3.6.1 (Tomcat 5.5.9). Smooth process as usual with just a couple minor points make a note of. more…

Liferay Pro 3.5.0, Tomcat 5.5, and Spring Portlet Sample

Wednesday, July 27th, 2005

I finally got around to try hot-deploying a standard JSR 168 portlet into Liferay Pro 3.5+Tomcat 5.5.9. The portlet application being used is the Spring Portlet Support Sample Application. The bottom line: it does the job, and in a satisfactory manner, meanwhile, it also leaves me some wishlist items. more…

Composite Property Binding

Wednesday, June 22nd, 2005

Very useful technique. See this forum post.

Inject Into Domain Objects

Tuesday, June 7th, 2005

There is an ongoing discussion on the Spring forums around DAO Reference Inside an Entity Domain Object?. Putting aside the debate on whether the idea is sensible from a design perspective, a practical issue in implementing this approach is that, in a sophisticated application, domain objects, unlike those stateless business service objects or DAOs, are usually instantiated by the data access layer, e.g., an ORM tool such as Hibernate. Therefore it’s usually hard to inject dependencies into these domain objects through Spring. In this forum post, Rod Johnson and other guys described a way to inject into domain objects by handling Hibernate object lifecycle events, but as of Spring 1.2, the actually implementation is still in the Sandbox. In this blog entry, I will describe another AOP-based approach that “virtually” injects a DAO reference (or any other Spring bean in general) into a domain object. more…

Spring-manage Aspectwerkz Aspects

Monday, June 6th, 2005

Jonas Bonér devised a clever way to spring-manage aspects in his blog Spring and AspectWerkz - A Happy Marriage. The only drawback in his approach is that the bean factory managing the aspects must be called a certain name, and be created by the SpringAspectContainer, which limits the usability because in many cases (e.g. in a Spring MVC powered Web application) contexts might have to be instantiated somewhere else. So as the first application of the AppContextCollector I described in Global References To ApplicationContext(s) Unintrusively, SpringBeanAspectContainer provides an alternative, unintrusive way to manage aspects in Spring. more…

Global References To ApplicationContext(s) Unintrusively

Monday, June 6th, 2005

Spring provides an out-of-box SingletonBeanFactoryLocator (or WebApplicationContextUtils in the case of a Web application) for code to globally reference bean factories and application contexts. The class takes a resource string (by default “classpath*:beanRefFactory.xml”) and builds a bean factory from all the definition files on the classpath matching the resource string. Most of the time this suffices - straightforward and easy to use. However this locator-also-creates approach can be inconvenient in some cases, where I don’t find myself having control over when and how to create the bean factories. This is where my “passive” AppContextCollector comes in. more…

RedirectView Fails In IE

Saturday, May 21st, 2005

This isn’t really a Spring issue, but the symptom was reported on the Spring Forum. It’s good to know that IE has this limitation of 2083 characters for query strings.