add testcase for 2961
improve Function Len
solved ticket https://issues.jboss.org/browse/RAILO-2961