1

I have compiled all Java-related interview questions and answers into PDF, and bookmarked the table of contents, which is very convenient to read

questions and answers PDF download : https://www.hicxy.com/?p=2645

questions and answers PDF download : https://www.hicxy.com/?p=2645

questions and answers PDF download : https://www.hicxy.com/?p=2645

1. What are the ways to read configuration in Spring Boot?

Spring Boot can pass

  • @PropertySource
  • @Value
  • @Environment,
  • @ConfigurationProperties

To bind variables

2. What is the core configuration file of spring boot? What is the difference between bootstrap.properties and application.properties?

Simply doing Spring Boot development may not be easy to encounter the bootstrap.properties configuration file, but when combined with Spring Cloud, this configuration will often be encountered, especially when you need to load some remote configuration files.

Spring boot core two configuration files:

  • bootstrap (. yml or. Properties): boostrap is loaded by the parent ApplicationContext, which is loaded prior to applicaton. The configuration takes effect in the boot phase of the application context. Generally speaking, we will use it in Spring Cloud Config or Nacos. And the attributes in boostrap cannot be overwritten;
  • application (. yml or. Properties): is loaded by ApplicatonContext and used for automatic configuration of spring boot projects.

3. What is the difference between Spring Boot's JAR and ordinary JAR

1, Spring Boot project finally packaged into the jar is an executable jar, this kind of jar can be directly run through the java -jar xxx.jar command, this kind of jar cannot be used as a normal jar by other projects, even if it is dependent on It is also not possible to use the classes in it.
2. Spring Boot's jar cannot be relied on by other projects, mainly because its structure is different from ordinary jars. Ordinary jar package, the package name is directly after decompression, and our code is in the package. After the executable jar packaged by Spring Boot is decompressed, it is our code in the \BOOT-INF\classes directory, so it cannot be directly Reference. If you have to refer to it, you can add configuration to the pom.xml file and package the Spring Boot project into two jars, one executable and one referenceable.

4. How do we monitor all Spring Boot microservices?

Spring Boot provides monitor endpoints to monitor the metrics of each microservice. These endpoints are useful for obtaining information about applications (such as whether they have been started) and whether their components (such as databases, etc.) are functioning normally. However, one of the main disadvantages or difficulties of using the monitor is that we must open the knowledge points of the application separately to understand its status or health. Imagine a microservice involving 50 applications. The administrator will have to hit the execution terminals of all 50 applications. To help us deal with this situation, we will use the open source project located at. It is built on Spring Boot Actuator, which provides a Web UI that allows us to visualize the metrics of multiple applications.

5. What is the starter in Spring Boot?

First of all, this Starter is not a new technical point, and is basically implemented based on the existing functions of Spring.

First of all, it provides an automated configuration class, generally named XXXAutoConfiguration. In this configuration class, conditional annotations are used to determine whether a configuration takes effect (conditional annotations are inherent in Spring), and then it also provides a series of default configurations , Developers are also allowed to customize the relevant configuration according to the actual situation, and then inject these configuration attributes through type-safe attribute injection, and the newly injected attributes will replace the default attributes. Because of this, many third-party frameworks can be used directly by introducing dependencies. Of course, developers can also customize Starter

For the rest of the problem, you can first think about it for yourself.

In addition, I have sorted out all Java-related interview questions and answers for your reference

questions and answers PDF download : https://www.hicxy.com/?p=2645

questions and answers PDF download : https://www.hicxy.com/?p=2645

questions and answers PDF download : https://www.hicxy.com/?p=2645

6. How to run Spring Boot application on custom port?

7. What is the principle of Spring Boot automatic configuration?

8. What is the use of spring-boot-starter-parent?

9. What is a CSRF attack?

10. What is the easiest way to create a Spring Boot Project?

11. What is YAML?

12. What is JavaConfig?

13. What is the difference between Spring Boot, Spring MVC and Spring?

14. How do you understand Starters in Spring Boot?

15. What is the core annotation of Spring Boot? Which annotations are mainly composed of?

16. Detailed explanation of Spring Boot configuration loading sequence

17. What are the core configuration files of Spring Boot? What is the difference between them?

18. What is Swagger? Have you implemented it with Spring Boot?

19. How to integrate Spring Boot and ActiveMQ?

20. When a Spring Boot application runs as a Java application, what happens in the background?

21. What does SpringBoot do when it starts?

22. What logging frameworks does Spring Boot support? Which is the recommended and default logging framework?

23. How to solve cross-domain problems in Spring Boot?

24. What is JavaConfig?

25. What is Spring Data?

26. How does Spring Boot initialize environment variables?

27. What are the advantages of YAML configuration?

28. What is the directory structure of Spring Boot?

29. What other Starter Project Options does Spring Boot provide?

30. Is Spring Initializr the only way to create Spring Boot Projects?

31. What is the principle of SpringBoot automatic configuration?

32. What is the difference between a Spring Boot jar and a regular jar?

33. What is the difference between RequestMapping and GetMapping?

34. Why do we not recommend using Spring Data Rest in actual applications?

35. What is the difference between Spring Boot, Spring MVC and Spring?

36. What is springboot?

37. What is an embedded server? Why should we use an embedded server?

38. What is the core annotation of Spring Boot? Which annotations are mainly composed of?

39. The execution principle of spring boot starter

40. How to understand "Convention is better than configuration" in Spring Boot

41. Compare the advantages and disadvantages of Spring Security and Shiro?

42. Does SpringBoot need a separate container to run?

43. What are the ways to run Spring Boot?

44. The principle of springboot automatic configuration

45. How to disable a specific automatic configuration class?

46. How to realize session sharing in microservices

47. How to reload the changes on Spring Boot without restarting the server?

48. Why do we need spring-boot-maven-plugin?

49. What are the advantages of Springboot?

50. What is Spring Batch?

51. What is Spring Boot Stater?

52. What are the starters commonly used in SpringBoot?

53. What is Spring Profiles?

54. What is the monitor in Spring Boot?

55. How many ways does SpringBoot implement hot deployment?

56. Principle of SpringBoot

57. Can Spring Boot use XML configuration?

58. Springboot integration process of mybatis

59. What is the use of spring-boot-starter-parent

60. How to implement timing tasks in Spring Boot?

61. Spring Boot scanning process?

62. How does Spring Boot define multiple sets of different environment configurations?

63. How to use Spring Boot to realize paging and sorting?

64. What is Spring Data REST?


胖胖胖胖虎阿
224 声望172 粉丝

No BB,Show code。