Skip to content

String input of weekdays in German to Localdate

I have a string input of weekdays in German and need to get the next Localdate after today which corresponds to the given weekday string. If for example the input is Montag (Monday) I need the output as Localdate of 2022-05-16 which is the next Monday after today. If the input was in english I could do someth…

How to properly use Exception method getMessage

I have the following java code: how can I set e.getMessage() so that System.out.println(e.getMessage()) will print “Pretty please enter an int: ” Answer You only set the message when the exception is created, it’s an argument to the constructor. In your case it would have been nice if the In…

Return link from Hateos

I have this old Spring Hateos code which I want to migrate to the latest version: I tried this: I get error at this line: Can you advise what is the correct way to implement this? Answer Based on your comments & question for migration this is what I am suggesting: …. //calling addLinlk And inside ad…