Spring Boot Questions-part 2

Source: Internet
Author: User

    • What is Spring-boot-devtools?

Applications that use Spring-boot-devtools would automatically restart whenever files on the classpath change. This can is a useful feature when working in an IDE as it gives a very fast feedback loop for code changes.

Spring-boot-devtools How to use, what are the options?

    • What is Livereload?

The Spring-boot-devtools module includes an embedded livereload server so can be used to trigger a browser refr Esh when a resource is changed. Livereload Browser extensions is freely available for Chrome, Firefox and Safari from livereload.com.

Read More Spring Boot Devtools

You can see how livereload works.

Plugin to understand, write blog

    • How to exclude auto restart for static files?

By default changing resources In/meta-inf/maven,/meta-inf/resources,/resources,/static,/public Or/templates would not Trigger a restart
But If you want to customize these exclusions you can use the Spring.devtools.restart.exclude property
If you want to keep those defaults and add additional exclusions, use the Spring.devtools.restart.additional-exclude prope Rty instead

Read More Spring Boot Devtools

    • How to start spring the boot application in debug mode?

Java-jar Myproject-0.0.1-snapshot.jar–debug

    • What is the advantages of YAML file than Properties file?

YAML is a superset of JSON, and as such are a very convenient format for specifying hierarchical configuration data. The Springapplication class would automatically support YAML as a alternative to properties whenever the Snakeyam L Library on your classpath.

    • What is the different ways to load YAML file in Spring boot?

1. Yamlpropertiesfactorybean'll load YAML as Properties
2. Yamlmapfactorybean'll load YAML as a Map

    • What is the advantages of spring externalized Configuration?

Externalize your configuration to work with the same application code in different environments. You can use the properties files, YAML files, environment variables and command-line arguments to externalize configuration.

    • What is Profiles in spring boot?

Spring Profiles provide a segregate parts of your application configuration and make it only available in certain E Nvironments. Any @Component or @Configuration can being marked with @Profile to limit when it is loaded

    • How to write the custom log configuration in spring boot?

You can force Spring Boot to use a particular logging system using the Org.springframework.boot.logging.LoggingSystem Syst Em property. The value should be the Fully-qualified class name of a Loggingsystem implementation. You can also disable Spring Boot ' s logging configuration entirely by using a value of none.

    • How does customize Favicon in spring boot Web application?

Spring Boot looks for a favicon.ico in the configured static content locations and the root of the Classpath R). If such file is present, it is automatically used as the favicon of the application.

    • How does spring boot handles error in application?

Spring Boot provides an/error mapping by default the handles all errors in a sensible the, and it is registered as a ' GL Obal ' ERROR page in the servlet container.

    • How does the Create a deployable war file in spring boot?

Step1:extend Springbootservletinitializer and override its Configure method
Step 2:change packing Type to war in Pom.xml or in Build.gradle
Step 3:mark the embedded servlet container dependency as provided

Spring Boot Questions-part 2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.