码迷,mamicode.com
首页 > 编程语言 > 详细

Questions on Spring Boot – Part 3

时间:2018-06-17 16:00:08      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:for   tin   render   jobs   under   back   sse   ted   SQ   

  • What is Hot swapping in spring boot?

Reloading the changes without restarting the server is called hot swapping, Modern IDEs (Eclipse, IDEA, etc.) all support hot swapping of bytecode,  so if you make a change that doesn’t affect class or method signatures it should reload cleanly with no side effects.

//不是affect class or method signatures的话, 举个具体的例子

 

  • How do you Switch off the Spring Boot security configuration?

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

//有代码举例更好

 

  • How to execute Spring Batch jobs on startup?

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

//有代码举例更好,用在哪里,怎么用

 

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

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

//如何引入, https://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html

 

  • How do you configure Configure Logback for logging?

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

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

 

  • How do you Configure Log4j for logging?

Spring Boot supports Log4j 2 for logging configuration if it is on the classpath. If you are using the starters for assembling dependencies that means you have to exclude Logback and then include log4j 2 instead

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

//log有必要写blog或者github project

//需要比较一下 logback和log4j吗?怎么include log4并且exclude logback

 

  • How do you 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 Jackson2 is on the classpath

 

  • How do you Write an XML REST service in spring boot?

If you have the Jackson XML extension (jackson-dataformat-xml) on the classpath, it will be used to render XML responses

//是不是要比较一下两者? github project

 

  • What is 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 file data in a single request.

 

  • How do you 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

//  server compression 有什么作用?

 

  • How do you add Add a Servlet, Filter or Listener to an application ?

There are two ways to add Servlet, Filter, ServletContextListener and the other listeners supported by the Servlet spec to your application. You can either provide Spring beans for them, or enable scanning for Servlet components.

//代码实例?

 

  • How do you Change tomcat or jetty HTTP port?

You can change the tomcat http port by changing default http property in application.properties file.

//具体怎么配置?

Questions on Spring Boot – Part 3

标签:for   tin   render   jobs   under   back   sse   ted   SQ   

原文地址:https://www.cnblogs.com/vicky-project/p/9192910.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!