Category: Spring Boot

  • Spring Boot SSL with Android Retrofit

    To setup Spring Boot SSL with Android Retrofit connecting on HTTPS 443: In Spring Boot <your project>/src/main/resources/application.properties – add the following values (not the “1.” which is just WordPress ordered list numbering) security.require-ssl=true server.port=8443 server.ssl.key-store=src/main/resources/private/keystore server.ssl.key-store-password=changeit server.ssl.key-password=changeit create and add an SSL key to the location specified by server.ssl.key-store. Note: the SSL certificate file is…

  • Retrofit error 415 400 object with Date field Fix @JsonFormat annotation

    Retrofit error 415 or error 400 on an object with a Date field can be fixed by using @JsonFormat annotation with the proper date pattern format specified in the annotation. java.util.Date toString() (for my locale/region) returns a string date format of MMM dd, yyyy hh:mm:ss aa Example: Oct 22, 2015 11:09:55 PM For Retrofit /…

  • H2 Web Console to In Memory Database – Spring Boot

    To get an H2 Database Web Console accessing an in-memory database running on Spring Boot: Register H2’s WebServlet (with UrlMapping /console/*) to your Spring project in a Configuration annotated class. Restart your Application. Open a web page to http://localhost:8080/console/ Be sure you’re accessing the correct database JDBC URL (default would be jdbc:h2:mem:testdb) (Credit: Spring Framework Guru)   import org.h2.server.web.WebServlet;…