added generic failure.jsp and refactored classes to use it