Skip to main content

Posts

Showing posts from December, 2018

@interface vs interface in Java

@interface is an annotation type declaration which resembles a Java Interface declaration - interface. Examples of standard Java annotations include @Override, @SuppressWarning etc. Java has always had meta-data tags like transient and Javadoc tag @deprecated. Annotations do not impact the flow of the program but impact the way a program is treated by tools or libraries.

Best Practices: Config changes in Spring Boot

Any additional Spring configuration beyond what Spring boot auto-configuration provides, its always better to write separate @Configuration-configured classes. These @Configuration annotated classes will be picked up by component scanning and included in the Spring configuration. Its always judicial to avoid adding configuration to the primary Spring configuration class or application's bootstrap class.

Spring Boot default Tomcat server port change

By default, Spring boot starts Tomcat server on port 8080. This can however be changed by a simple configuration update to the application.properties file in the resource folder. Add the following entry to the application.properties file to change the port at which Tomcat server is hosted: server.port=8085