Posts

Showing posts from June, 2021

Java Interview Questions and answer for experience

Image
  Spring Boot Questions :-  Disable Tomcat server FromSpringStarter we can add @SpringBootApplication(exclude = {EmbeddedServletContainerAutoConfiguration.class, WebMvcAutoConfiguration.class}) annotation to remove embedded tomcat server   Or execlude tomcat starter web from pom.xml   <exclusions>         <exclusion>             <groupId>org.springframework.boot</groupId>             <artifactId>spring-boot-starter-tomcat</artifactId>         </exclusion>     </exclusions> How to Change Tomcat port:- server.port=8081 How to Disable web server dependencies spring.main.web-application-type=none How to disable AutoConfigure class :- @EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class}) What does @SpringBootApplication do :-   @ SpringBootApplication annotation can be used to enable those three features, that is:   @ EnableAutoConfiguration : enable Spring Boot’s auto-configuration mechanism @ Com