Questions on Spring Boot–part 3

Source: Internet
Author: User
Tags log4j

    • What's hot swapping in spring boot?

Reloading the changes without restarting the server is called hot swapping, modern IDEs (Eclipse, Idea, etc.) Hot swapping of bytecode, so if you do a change that doesn ' t affect class or method signatures it should Reloa D cleanly with no side effects.

Not affect class or method signatures, give me a concrete example.

    • How does the Switch off the Spring Boot security configuration?

If you define a @Configuration with @EnableWebSecurity anywhere in your application it would switch off the Defaul T webapp security settings in Spring Boot.

Have code examples better

    • How do I execute Spring Batch jobs on startup?

Spring Batch auto-configuration is enabled by adding @EnableBatchProcessing (from Spring batch) somewhere in yo ur context. By default it executes all Jobs in the application context on startup

There are code examples better, where to use, how to use

    • Does Spring boot need Logging? What is the default one?

Spring Boot has no mandatory logging dependency, except for the Commons logging API.

How to introduce, https://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html

    • How does configure configure Logback for logging?

If you put a logback.xml in the root of your classpath it'll be picked up from there

Detailed, https://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html

    • How does Configure log4j for logging?

Spring Boot supports log4j 2 for logging configuration if it's on the classpath. If you is using the starters for assembling dependencies This means you has to exclude Logback and then Inc Lude log4j 2 instead

Detailed, https://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html

Log it is necessary to write blog or GitHub project

Do you need to compare logback and log4j? How to include LOG4 and exclude Logback

    • How does a write a write a JSON REST service in spring boot?

Any spring @RestController in a spring Boot application should render JSON response by default as long as Jac Kson2 is on the classpath

    • How does you Write a XML REST service in spring boot?

If you had the Jackson XML extension (jackson-dataformat-xml) on the classpath, it would be used to render XM L Responses

Do you want to compare the two? GitHub Project

    • What's the default Multipart File uploads size in spring boot?

By default spring Boot configures Spring MVC with a maximum file of 1MB per file and a maximum of 10MB of the file data in A single request.

    • How does the Enable HTTP response compression in spring boot?

HTTP response compression is supported by Jetty, Tomcat, and Undertow. It can be enabled by adding server.compression.enabled=true in Application.properties

What is the role of server compression?

    • How does the add Add a Servlet, Filter or Listener to an application?

There is ways to add Servlets, Filter, Servletcontextlistener and the other listeners supported by the Servle T spec to your application. You can either provide Spring beans for them, or enable scanning for servlets components.

Code instance?

    • How does the change Tomcat or jetty HTTP port?

You can change the Tomcat for HTTP port by changing default HTTP property in Application.properties file.

How exactly is it configured?

Questions on Spring Boot–part 3

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.