logo
Apr
12

Exploring the Grails Cache Plugin: Evicting Multiple Caches

Exploring the Grails Cache Plugin: Evicting Multiple Caches The more recent version of Grails bundle a cute little Cache plugin that abstracts some of the Cache classes built into Spring 3.1. For the common use cases, you can simply make use of the @Cacheable annotation, and then make use of @CacheEvict when you need to clean things out. But this sample code demonstrates what to do when you need to evict several caches on a  single method call (for instance,...
Apr
12

Extracting the raw XML of an element using Commons Digester

Extracting the raw XML of an element using Commons Digester I’ve recently had to parse out some semi-structured xml and marshall it into an object graph. I’d normally use JAXB in a heartbeat but the random, schemaless design of this particular large xml doc (full of random reuse of tag names inside other tags as you’ll see) made that pretty much impossible. So I was originally thinking of doing it all by hand in StaX using the XmlEventReader....
Jan
30

A Lesser Known Grails Tag: g:external

A Lesser Known Grails Tag: g:external Working on refreshing the “tasty views and layouts” chapter for Grails in Action 2.0 and came across the gem that is the g:external tag. Grails 2.0 introduced this cute little tag called <g:external> for that very common case of linking to CSS, JavaScript and favicons. Back in the old days, you used to use some kind of “resource” link, perhaps as a method call for brevity (or...
Jan
23

Has my File finished copying to my uploads directory?

Has my File finished copying to my uploads directory? So your Java app is scanning an uploads directory for files that the user will copy in (perhaps via a Windows share). The only snag is that the files can be very large, and you don’t want to *start* processing a partially uploaded file. What to do? So, today’s challenge: finding a way to tell if a given File has completed copying to the upload directory or is still in the process of being...
Jan
4

Getting TomEE working with JBoss Developer Tools 6

Getting TomEE working with JBoss Developer Tools 6 I’ve spent the day playing around with TomEE 1.5 plus and I have to say that I’m very impressed. The server starts up in a heartbeat, I could happily deploy my Glassfish EE6/PrimeFaces/JPA2 maven war to it with no app config changes to the app (bar a resource-ref). That’s pretty impressive since it’s using a completely different JPA provider, EJB container, and JSF implementation!...
Jan
1

Reviewing my Personal Tech Goals for 2012

Reviewing my Personal Tech Goals for 2012 Well, I started 2012 with list of tech goals for 2012, and since it’s Jan 1st, it’s probably time for a small retrospective to see how I went. Grails 2.0 Deep Dive. Did ok on this one. I’ve spend most of the year working full time on a big commercial Grails application, and this year I definitely levelled up my commercial development. In particular, I’ve done a lot of work with...
Dec
29

Using Apache Shiro with JSF

Using Apache Shiro with JSF   Update: BalusC has done an amazing post about Shiro/JSF. Head over there instead! I know very little about JSF2, and even less about Apache Shiro, but both have been on the learning list for a while, so this blog will document up how to get them working together from beginner’s eyes. Be gentle. I’ve deployed the sample to JBoss OpenShift while I’m experimenting, if you’d like...

« Previous Entries

logo
Powered by WordPress | Designed by Elegant Themes