<div dir="ltr" style="text-align: justify;" trbidi="on">
<div dir="ltr" style="text-align: justify;" trbidi="on">
<div style="font-family: calibri, sans-serif; text-align: justify;">
<div style="font-size: 12pt;">
<div style="font-size: 12pt;">Spring Boot reduced lots of spring configuration and kick o fast development. Spring Boot offers a new paradigm for developing Spring applications with minimal friction. With Spring Boot, you’ll be able to develop Spring applications with more agility and be able to focus on addressing your application’s functionality needs with minimal.</div>
<div style="font-size: 12pt;">
</div>
<div style="font-size: 12pt;">Spring Boot is well suited for web application development. You can easily create a self-contained HTTP server using embedded Tomcat, Jetty, or Undertow. Most web applications will use the spring-boot-starter-web module to get up and running quickly.</div>
<div style="font-size: 12pt;">
<div align="center" id="ads-id"></div>
</div>
<div style="font-size: 12pt;"><b>Spring Web MVC framework</b></div>
<div style="font-size: 12pt;"><b>MVC </b>stands for <b>Model</b>, <b>View</b>, <b>Controller</b>. The MVC design pattern is probably the most popular design pattern used when writing code to generate dynamic web content.</div>
<div style="font-size: 12pt;"></div>
<ul style="font-size: 12pt;">
<li><b>Model </b>refers to a data model, or some type of data structure.</li>
<li>The <b>view </b>layer, in Java frequently a JSP. This will take data from the Model and render the view.</li>
<li>Spring MVC lets you create special <b>@Controller</b> or <b>@RestController</b> beans to handle incoming HTTP requests. Methods in your controller are mapped to HTTP using <b>@RequestMapping</b> annotations.</li>
</ul>
<div style="font-size: 12pt;">
</div>
<div style="font-size: 12pt;">
</div>
<div style="font-size: 12pt;"><b>Spring MVC auto-configuration</b></div>
<div style="font-size: 12pt;">Spring Boot provides auto-configuration for Spring MVC. There are following features for auto-configuration for Spring MVC.</div>
<div style="font-size: 12pt;"></div>
<ul style="font-size: 12pt;">
<li>Inclusion of <b>ContentNegotiatingViewResolver </b>and <b>BeanNameViewResolver </b>beans.</li>
<li>Support for serving <b>static </b>resources, including support for <b>WebJars</b>. By default Spring Boot will serve static content from a directory called <b>/static</b> (or <b>/public</b> or <b>/resources</b> or <b>/META-INF/resources</b>) in the <b>classpath </b>or from the root of the <b>ServletContext</b>. It uses the <b>ResourceHttpRequestHandler </b>from Spring MVC so you can modify that behavior by adding your own <b>WebMvcConfigurerAdapter </b>and overriding the <b>addResourceHandlers </b>method. Any resources with a path in <b>/webjars/** </b>will be served from jar files if they are packaged in the <b>Webjars </b>format.</li>
<li>Automatic registration of <b>Converter</b>, <b>GenericConverter</b>, <b>Formatter </b>beans.</li>
<li>Support for <b>HttpMessageConverters</b>. Spring MVC uses the <b>HttpMessageConverter </b>interface to convert HTTP requests and responses.</li>
<li>Automatic registration of <b>MessageCodesResolver</b>. Spring MVC has a strategy for generating error codes for rendering error messages from binding errors: <b>MessageCodesResolver</b></li>
<li>Static <b>index.html</b> support. If you do this the default welcome page detection will switch to your custom locations, so if there is an <b>index.html</b> in any of your locations on startup, it will be the home page of the application.</li>
<li>Custom <b>Favicon </b>support.</li>
<li>Automatic use of a <b>ConfigurableWebBindingInitializer </b>bean. Spring MVC uses a <b>WebBindingInitializer </b>to initialize a <b>WebDataBinder </b>for a particular request. If you create your own <b>ConfigurableWebBindingInitializer @Bean</b>, Spring Boot will automatically configure Spring MVC to use it.</li>
<li>When you’re using one of these <b>templating </b>engines (<b>thymeleaf, freemarker, velocity, Groovy</b> etc.) with the default configuration, your templates will be picked up automatically from <b>src/main/resources/templates</b>.</li>
<li><b>Error Handling</b> Spring Boot provides an <b>/error</b> mapping by default that handles all errors in a sensible way, and it is registered as a ‘global’ error page in the servlet container. For machine clients it will produce a JSON response with details of the error, the HTTP status and the exception message. For browser clients there is a ‘<b>whitelabel</b>’ error view that renders the same data in HTML format. If you want to display a custom HTML error page for a given status code, you add a file to an /error folder. Error pages can either be static HTML (i.e. added under any of the static resource folders) or built using templates. The name of the file should be the exact status code or a series mask.</li>
<li><b>Spring Boot</b> includes support for <b>embedded Tomcat</b>, <b>Jetty</b>, and <b>Undertow servers</b>. Most developers will simply use the appropriate ‘<b>Starter</b>’ to obtain a fully configured instance. By default the embedded server will listen for HTTP requests on port <b>8080</b>.</li>
<li>Any <b>Servlet</b>, <b>Filter </b>or <b>Servlet *Listener </b>instance that is a Spring bean will be registered with the embedded container. This can be particularly convenient if you want to refer to a value from your <b>application.properties</b> during configuration.</li>
<li>By default, if the context contains only a <b>single Servlet </b>it will be <b>mapped to /</b>. In the case of <b>multiple Servlet beans</b> the bean <b>name will be used as a path prefix</b>. <b>Filters </b>will <b>map to /*</b>. </li>
<li><b>EmbeddedWebApplicationContext </b>The EmbeddedWebApplicationContext is a special type of <b>WebApplicationContext </b>that bootstraps itself by searching for a single <b>EmbeddedServletContainerFactory </b>bean.</li>
</ul>
<p><b>Customizing embedded servlet containers</b></p>
<div style="font-size: 12pt;">Common servlet container settings can be configured using Spring Environment properties. Usually you would define the properties in your <b>application.properties</b> file.</div>
<div style="font-size: 12pt;"></div>
<ul>
<li><b>Network settings:</b> listen port for incoming HTTP requests (<b>server.port</b>), interface address to bind to <b>server.address</b>, etc.</li>
<li><b>Session settings: </b>whether the session is persistent (<b>server.session.persistence</b>), session timeout (<b>server.session.timeout</b>), location of session data (<b>server.session.store-dir</b>) and session-cookie configuration (<b>server.session.cookie.*</b>).</li>
<li><b>Error management: </b>location of the error page (<b>server.error.path</b>), etc.</li>
</ul>
<p></p>
<div style="background-color: #f2f9fc; border-radius: 3px; border: 1px solid #c9e6f2; line-height: 1.45; padding: 16px;"><b>Spring Boot Related Topics</b></p>
<ol style="text-align: left;">
<li><b><a href="https://dineshonjava.com/2017/04/spring-boot-interview-questions-and-answers.html">Spring Boot Interview Questions and Answers</a></b></li>
<li><b><a href="https://dineshonjava.com/2016/06/introduction-to-spring-boot-a-spring-boot-complete-guide.html">Introduction to Spring Boot</a></b></li>
<li><a href="https://dineshonjava.com/2016/06/essentials-key-components-and-internals-of-spring-boot-framework.html"><b>Essentials and Key Components of Spring Boot</b></a></li>
<li><a href="https://dineshonjava.com/2016/06/spring-boot-cli-installation-and-hello-world-example.html"><b>Spring Boot CLI Installation and Hello World Example</b></a></li>
<li><a href="https://dineshonjava.com/2016/06/spring-boot-initilizr-web-interface-and-examples.html"><b>Spring Boot Initializr Web Interface</b></a></li>
<li><a href="https://dineshonjava.com/2016/06/spring-boot-initilizr-with-ides-via-spring-tool-suite.html"><b>Spring Boot Initializr With IDEs</b></a></li>
<li><a href="https://dineshonjava.com/2016/07/spring-boot-initializr-with-spring-boot-cli.html"><b>Spring Boot Initializr With Spring Boot CLI</b></a></li>
<li><a href="https://dineshonjava.com/2016/07/installing-spring-boot.html"><b>Installing Spring Boot</b></a></li>
<li><a href="https://dineshonjava.com/2016/07/developing-your-first-spring-boot-application-hello-world.html"><b>Developing your first Spring Boot application</b></a></li>
<li><a href="https://dineshonjava.com/2016/07/customizing-spring-boot-auto-configuration.html"><b>External Configurations for Spring Boot Applications</b></a></li>
<li><a href="https://dineshonjava.com/2016/07/logging-configuration-in-spring-boot.html"><b>Logging Configuration in Spring Boot</b></a></li>
<li><a href="https://dineshonjava.com/2016/08/working-with-sql-databases-in-spring-boot-application.html"><b>Working with SQL Databases and Spring Boot</b></a></li>
<li><a href="https://dineshonjava.com/2016/08/mysql-configuration-with-spring-boot.html"><b>MySQL Configurations</b></a></li>
<li><a href="https://dineshonjava.com/2016/08/spring-data-jpa-using-in-spring-boot-application.html"><b>Spring Data JPA using Spring Boot Application</b></a></li>
<li><a href="https://dineshonjava.com/2016/08/spring-boot-with-nosql-technologies.html"><b>Spring Boot with NoSQL technologies</b></a></li>
<li><a href="https://dineshonjava.com/2016/08/spring-cache-tutorial.html"><b>Spring Cache Tutorial</b></a></li>
<li><a href="https://dineshonjava.com/2016/08/spring-security-tutorial-using-spring-boot.html"><b>Spring Security Tutorial with Spring Boot</b></a></li>
<li><a href="https://dineshonjava.com/2016/08/spring-boot-and-mongodb-in-rest-application.html"><b>Spring Boot and MongoDB in REST Application</b></a></li>
<li><b><a href="https://dineshonjava.com/2016/08/spring-boot-actuator-complete-guide.html">Complete Guide for Spring Boot Actuator</a></b></li>
<li><b><a href="https://dineshonjava.com/2017/01/microservices-with-spring-boot.html">Microservices with Spring Boot</a></b>
</li>
</ol>
</div>
<p>
</div>
</div>
</div>
</div>
<div class="wp-post-navigation"> 
									 <div class="wp-post-navigation-pre"> 
									 <a href="https://dineshonjava.com/logging-configuration-in-spring-boot/">Previous</a> 
									 </div> 
									 <div class="wp-post-navigation-next"> 
									 <a href="https://dineshonjava.com/working-with-sql-databases-in-spring-boot-application/">Next</a> 
									 </div> 
									</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
 $.post('https://dineshonjava.com/wp-admin/admin-ajax.php', {action: 'mts_view_count', id: '137'});
});
</script>
Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…
Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…
Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…
Technology has emerged a lot in the last decade, and now we have artificial intelligence;…
Managing a database is becoming increasingly complex now due to the vast amount of data…
Overview In this article, we will explore Spring Scheduler how we could use it by…