xpam.pl

Tag: java

  • HTPP Accept-Language request header to ResourceBundle

    HTTP Accept-Language header is specified by the client to inform the backend what the preferred language for the response is. In Java, the go-to utility for handling localization is ResourceBundle. What is missing is a standard way to properly convert the input header to the correct ResourceBundle. Specifically, ResourceBundle i18n = ResourceBundle.getBundle("bundles/translations", request.getLocale()); is insufficient.…

  • Can JPA @Version column be nullable?

    When using @Version with yor JPA entities you might be wondering, should you make the column nullable or not? There is no answer to this question in the documentation or the internet in general. The only way to find out was to test it. The answer is: column has to be not-null, at least for…