perjantai 9. huhtikuuta 2010

Hibernate-plugin refuses to install: A workaround

Failed to install plugin [hibernate-1.2.2]. Plugin has missing JAR dependencies.

How to fix this? No clue, but a workaround is to clear the ~/.ivy2 directory.

tiistai 6. huhtikuuta 2010

Using session-scoped services in Grails' taglib

Using services with session scope in tag libraries does not work in Grails, as per version 1.2.2. There's a fix promised in 1.3.0, but while waiting for it to be released, here's a simple workaround:

import org.springframework.context.ApplicationContextAware
import org.springframework.context.ApplicationContext

class DefaultTagLib implements ApplicationContextAware {
ApplicationContext applicationContext

def someTag = {attrs, body ->
applicationContext.documentService.doSomething()
}
}