У нас вы можете посмотреть бесплатно Spring Boot Interview Questions | Actuator | Profiles | @RestController | @Controller | Part 5 или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
In this session we will discuss the interview question on Spring boot. Q9 What is Combination of anotation @springBootApplication contain? Ans:- A single @SpringBootApplication annotation is used to enable the following annotations: @EnableAutoConfiguration: It enables the Spring Boot auto-configuration mechanism. @ComponentScan: It scans the package where the application is located. @Configuration: It allows us to register extra beans in the context or import additional configuration classes. Q10. What are the Spring Boot starters and what are available starters? Answer- Spring Boot starters are a set of dependency management providers that can be used in the application to enable dependencies. These starters, make development easy and rapid. All the available starters come under the org.springframework.boot group. Few of the popular starters are as follows: spring-boot-starter: – This is the core starter and includes logging, auto-configuration support, and YAML. spring-boot-starter-jdbc – This starter is used for connection pool with JDBC spring-boot-starter-web – helps for building web applications, including RESTful, applications using Spring MVC spring-boot-starter-data-jpa – Is the starter to use Spring Data JPA with Hibernate spring-boot-starter-security – is the starter used for Spring Security spring-boot-starter-aop: This starter is used for aspect-oriented programming with AspectJ and Spring AOP Q11. Explain Spring Actuator and its advantages? Ans:- Spring Actuator is a one of the important feature of Spring Boot with the help of which you can see what is happening inside a running application. Spring boot actuator we use to monitor our application in different enviroment It help in debuging your application. With the help of Spring Actuator it is easy access to features such as identifying beans, CPU usage, Health/Status , Thread Dump of Application etc. The Spring Actuator provides a very easy way to access the production-ready REST points and fetch all kinds of information from the web. In Spring boot version 2 – it gives two endpoint i.e, {[/actuator/health] and [/actuator/info] - only this two endpoints are enable for us as of now by default But in spring boot version 1 - it will show more ends points like bins, info, thread doms all those endpoints are enable by default in version 1. Q12. What is thymeleaf and how to use thymeleaf? Thymeleaf is a server-side Java template engine used for web applications. It aims to bring natural template for your web application and can integrate well with Spring Framework and HTML5 Java web applications. To use Thymeleaf, you need to add the following code in the pom.xml file: Q13. Can we change the port of the embedded Tomcat server in Spring boot? Ans Yes - by using server.port=8081 in application.properties file. Q14. What is the need for Spring Boot DevTools? Ans- Spring Boot 1.3 provides another module called Spring Boot DevTools. It restarts the spring boot application whenever any changes are being made in the code. So don’t need to right-click on the project and run your application again and again. Spring Boot dev tools does this for you with every code change The aim of the module is to try and improve the development time while working with the Spring Boot application. Spring Boot DevTools pick up the changes and restart the application. Q15. What are the advantages of the YAML file than Properties file? Ans YAML gives you more clarity then properties files. It also supports maps, lists, and other scalar types. YAML comes with hierarchical nature which helps in avoiding repetition. If we have different deployment profiles such as development, testing, or production and we may have different configurations for each environment, so instead of creating new files for each environment we can place them in a single YAML file. But in the case of the properties file, you cannot do that.You have to define different seperate files for this. Q16 What is Profiles and where it is used? Ans:- The application has different stages-such as the development stage, testing stage, production stage and may have different configurations based on the environments. With the help of spring boot, you can place profile-specific properties in different files such as application-{profile}.properties In the above, you can replace the profile with whatever environment you need, for example, if it is a development profile, then application-development.properties file will have development specific configurations in it. So, in order to have profile-specific configurations/properties, you need to specify an active profile. Q17 How to connect Spring Boot to the database using JPA? Ans:- Spring Boot provides spring-boot-starter-data-jpa starter to connect Spring application with relational database efficiently. Need to add it into project POM (Project Object Model) file. #springboot #interviewspringboot #java