Skip to content

Change deferredResult HTTP status code on timeout

I am using deferredResult on Spring MVC, but using this code, the timeout still are sending back the HTTP code 503 to the client. Any idea what else to try? Answer I ran into the same issue. My Spring MVC Controller method originally returned DeferredResult<Object>, but then I realised I wanted to contr…

TreeSet constructor with Comparator parameter

In Java’s documentation for its class TreeSet one of the constructors is shown to have the following header: Can someone help explain why there is a constructor for TreeSet which takes a comparator object as its argument? I have no clue why this is done. Answer The elements in a TreeSet are kept sorted. If yo…