fixed a problem when a wicket method throws StringIndexOutOfBoundsException on bad input