https://issues.jboss.org/browse/RAILO-3044

I am sure you can find a better way to fix this. I don't know the code very well.