Add test code and support handling for Java #2511

Create CSRFErrorHandler trait/interface to unified interface between Scala and Java