<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hamdamboy</title>
    <description>The latest articles on DEV Community by Hamdamboy (@urunov).</description>
    <link>https://dev.to/urunov</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F352553%2F414135fb-97e4-4cb0-ac31-1dc83d1040bf.jpeg</url>
      <title>DEV Community: Hamdamboy</title>
      <link>https://dev.to/urunov</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/urunov"/>
    <language>en</language>
    <item>
      <title>Spring Framework Architecture and Runtime Components</title>
      <dc:creator>Hamdamboy</dc:creator>
      <pubDate>Fri, 29 May 2020 08:32:12 +0000</pubDate>
      <link>https://dev.to/urunov/spring-framework-architecture-and-runtime-components-31id</link>
      <guid>https://dev.to/urunov/spring-framework-architecture-and-runtime-components-31id</guid>
      <description>&lt;p&gt;The mainly concentrated in this post on the Java/ Spring Framework, we are going to study the important modules of the Spring Framework. &lt;br&gt;
 Indeed, briefly inform about Spring Framework Architecture and Runtime components differences, and than &lt;a href="https://github.com/Urunov/Spring-DAO-ORM-JEE-Web-AOP-Core-Boot" rel="noopener noreferrer"&gt;implementation source codes&lt;/a&gt;.  &lt;/p&gt;

&lt;p&gt;| &lt;a href="https://github.com/Urunov/Spring-DAO-ORM-JEE-Web-AOP-Core-Boot" rel="noopener noreferrer"&gt;More source code in the git, you can use freely open source&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Spring Framework Architecure and Spring Framework Runtime (Figure-1).&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmip0zvxst626fmoxhskk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmip0zvxst626fmoxhskk.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's defining each components in the Figure-1. &lt;/p&gt;

&lt;h3&gt;
  
  
  Aspect-Oriented Programming
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Aspect Oriented Programming(AOP) is the important part of the Spring Framework. The Aspect-Oriented Programming used for separating cross-cutting concerns (for example logging, security etc.) from the business logic of the application.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Model-View-Controller (MVC)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;It an HTTP and servlet-based framework, this provides customization for web applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Transaction Management
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;TM is used to unify several transaction management APIs and to coordinate transactions for Java objects.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Core container
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The core container is the heart of Spring framework and all other modules are built on top of it. It provides the dependency injection feature, also is known as inversion of control. This module contains the BeanFactory (an implementation of factory pattern) which creates and manages the life cycle of the various application objects (known as beans) defined in the Spring bean configuration file.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Application context
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;This module provides various enterprise level services, scheduling, JNDI access, email etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Spring DAO
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Almost every enterprise application needs to interact with the database. Spring DAO module makes it easy to interact with database by providing an abstraction over low level JDBC tasks like creating a database connection, release it etc.&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TodoRepository.java

  @Repository
   public interface TodosRepository extends CrudRepository&amp;lt;Todo, Integer&amp;gt; { }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4jql3i6apyr7m2bdladf.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4jql3i6apyr7m2bdladf.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ORM
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;There exist a number of popular object-relational mapping tools like Hibernate, iBatis, JPA etc. Spring ORM module helps in integrating with these tools.&lt;br&gt;
ToDoService.java&lt;/p&gt;


&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      @Service
      @Transactional
      public class TodoService {
      private final TodosRepository todosRepository;
      public TodoService(TodosRepository todosRepository) {
        this.todosRepository = todosRepository;
      }
    public List&amp;lt;Todo&amp;gt; findAll(){
    List&amp;lt;Todo&amp;gt; todos = new ArrayList&amp;lt;&amp;gt;();
    for(Todo todo : todosRepository.findAll()) {
        todos.add(todo);
     }
      return todos;
    }

    public void save(Todo todo){
    todosRepository.save(todo);
  }

    public void delete(int id) {
      Optional&amp;lt;Todo&amp;gt; todo = todosRepository.findById(id);
      todosRepository.delete(todo.get());
    }

     public Optional&amp;lt;Todo&amp;gt; findTodo(int id){
       return todosRepository.findById(id);
     }
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Inversion of Control (IoC) or Dependency Injection (DI)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A typical java based enterprise application consists of a number of java classes. To accomplish its designated functionality, each java class (A.java) may depend on one or more other java classes. These other java classes are known as dependencies of the java class A.  Generally, each class takes the responsibility to obtain the references of the classes it depends upon. This leads to highly coupled application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Spring framework helps in developing the loosely coupled applications by delegating the responsibility of acquiring the dependencies of a java class to the Spring container and allowing the java class to focus only on its designated functionality. The Spring container injects the dependencies into the java class as the container is initialized (usually on application start up.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dependency injection is also known as inversion of control. Instead of java class obtaining their dependencies from the container, it is the container who is injecting the dependencies in the java class. So there is an inversion of control.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.codejava.net/frameworks/spring/understanding-the-core-of-spring-framework" rel="noopener noreferrer"&gt;https://www.codejava.net/frameworks/spring/understanding-the-core-of-spring-framework&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.spring.io/spring/docs/4.3.x/spring-framework-reference/html/overview.html" rel="noopener noreferrer"&gt;https://docs.spring.io/spring/docs/4.3.x/spring-framework-reference/html/overview.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dzone.com/articles/spring-framework-tutorial-for-beginners-2" rel="noopener noreferrer"&gt;https://dzone.com/articles/spring-framework-tutorial-for-beginners-2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Urunov/Spring-DAO-ORM-JEE-Web-AOP-Core-Boot" rel="noopener noreferrer"&gt;https://github.com/Urunov/Spring-DAO-ORM-JEE-Web-AOP-Core-Boot&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>java</category>
      <category>microservices</category>
      <category>webdev</category>
      <category>database</category>
    </item>
    <item>
      <title>Already Hacked - Security Environment of the System</title>
      <dc:creator>Hamdamboy</dc:creator>
      <pubDate>Thu, 14 May 2020 00:43:36 +0000</pubDate>
      <link>https://dev.to/urunov/already-hacked-security-environment-of-the-system-1b82</link>
      <guid>https://dev.to/urunov/already-hacked-security-environment-of-the-system-1b82</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WaXNuXbj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9q9jpy45qsd7o2i12o39.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WaXNuXbj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9q9jpy45qsd7o2i12o39.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My system hacked by power (reference video) &lt;/p&gt;

&lt;h2&gt;
  
  
  How to secure your system ( The mainly )
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c9HBHwMb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cmhcmwgutdzlx2ikylox.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c9HBHwMb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cmhcmwgutdzlx2ikylox.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Spring Boot Security (&lt;a href="https://github.com/Urunov/SpringBoot-Projects-FullStack/tree/master/Part-6%20Spring%20Boot%20Security"&gt;source code&lt;/a&gt; )
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create User entity to store user information&lt;/li&gt;
&lt;li&gt;Store the User in our database&lt;/li&gt;
&lt;li&gt;Link our User with User Details Interface
a. Link user with User Details interface
b. Link User repository with User Details Service Interface&lt;/li&gt;
&lt;li&gt;Integrate Database Auth in our configuration&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Linking with Spring Security&lt;/p&gt;

&lt;p&gt;UserDetails (interface) &amp;lt;--- UserDetailsService(interface)&lt;/p&gt;

&lt;p&gt;Authentication - Create User Entity&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ow18I7Ct--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ef7kfsegkv28syhhinty.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ow18I7Ct--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ef7kfsegkv28syhhinty.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  I have a Spring MVC. DO I need JWT to!?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If your application provided business logic and all the necessary UI.&lt;/li&gt;
&lt;li&gt;And you just have one application being deployed(war/jar)&lt;/li&gt;
&lt;li&gt;And if this is all your customer needs &lt;/li&gt;
&lt;li&gt;Then you do not need JWT. Form based security will work just fine.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>security</category>
      <category>serverless</category>
      <category>hacktoberfest</category>
      <category>saas</category>
    </item>
    <item>
      <title>How to handle Database in Spring Boot</title>
      <dc:creator>Hamdamboy</dc:creator>
      <pubDate>Fri, 08 May 2020 01:23:29 +0000</pubDate>
      <link>https://dev.to/urunov/how-to-handle-database-in-spring-boot-560</link>
      <guid>https://dev.to/urunov/how-to-handle-database-in-spring-boot-560</guid>
      <description>&lt;p&gt;Core data for Spring Boot with Database. Please you may use more source in there &lt;a href="https://github.com/Urunov/SpringBoot-Database"&gt;link&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;This provides Database implementation in the Spring Boot. Especially, we'll  briefly inform here concept of Spring, Spring Boot, JDBC, JPA, H2 and result of our experience project(there is link using github).&lt;/p&gt;

&lt;h1&gt;
  
  
  Spring
&lt;/h1&gt;

&lt;p&gt;The Spring Framework is an application framework and inversion of control container for the Java platform. Spring is HA (high avilability).&lt;br&gt;
Spring Boot&lt;/p&gt;

&lt;p&gt;Most Spring Boot applications need minimal Spring configuration. Features. Create stand-alone Spring applications&lt;/p&gt;

&lt;h1&gt;
  
  
  JPA
&lt;/h1&gt;

&lt;p&gt;JPA (The Java Presistence API) = This module deals with enhanced support for JPA based data access layers.Indeed, the JPA is set of the rules to interfaces. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JPA follows Object-Relation Mapping (ORM). It is a set of interfaces. It also provides a runtime EntityManager API for processing queries and transactions on the objects against the database. It uses a platform-independent object-oriented query language JPQL (Java Persistent Query Language).
Why should we use JPA? JPA is simpler, cleaner, and less labor-intensive than JDBC, SQL, and hand-written mapping. JPA is suitable for non-performance oriented complex applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;API (Application programming interface) is a document that contains a description of all the features of a product or software. It represents classes and interfaces that software programs can follow to communicate with each other. An API can be created for applications, libraries, operating systems, etc.&lt;/p&gt;

&lt;p&gt;JPA Implementations JPA is an open-source API. There is various enterprises vendor such as Eclipse, RedHat, Oracle, etc. that provides new products by adding the JPA in them. There are some popular JPA implementations frameworks such as Hibernate, EclipseLink, DataNucleus, etc. It is also known as Object-Relation Mapping (ORM) tool.&lt;/p&gt;

&lt;h1&gt;
  
  
  JDBC
&lt;/h1&gt;

&lt;p&gt;Java Database Connectivity (JDBC) is an application programming interface (API) for the programming language Java, which defines how a client may access a database.&lt;br&gt;
Architecture of the Project Implementation.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7A0hlKwt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/glx02kwoyoeq3k9ck73r.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7A0hlKwt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/glx02kwoyoeq3k9ck73r.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  H2
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;H2 is a relational database management system written in Java. It can be embedded in Java applications or run in client-server mode.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wBdJAlce--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/noa3b0p9djq4o7zmy9a6.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wBdJAlce--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/noa3b0p9djq4o7zmy9a6.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Spring Boot + JPA + Hibernate + MySQL|Oracle
&lt;/h1&gt;

&lt;p&gt;Real project configuration. &lt;a href="https://github.com/Urunov/SpringBoot-Database"&gt;Source&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Create a Maven Project&lt;br&gt;
You may use your tool(Eclipse, IntelliJ Idea, etc.), this example we used IntelliJ then create a new Maven project and name it SpringJDBC.&lt;/p&gt;

&lt;p&gt;At the end of this tutorial, we’ll get the following project structure:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xDtEwOL_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/267vzg8rks9t9t10i1wg.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xDtEwOL_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/267vzg8rks9t9t10i1wg.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  POM.XML
&lt;/h2&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;parent&amp;gt;
    &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;spring-boot-starter-parent&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;1.5.10.RELEASE&amp;lt;/version&amp;gt;
 &amp;lt;/parent&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Configuration DB&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xFT6r3Z7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fm5xz2ec634dc116mufh.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xFT6r3Z7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fm5xz2ec634dc116mufh.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Repositories&lt;br&gt;
We define our repositories' interfaces under spring.jdbc.dao. Each repository extends Spring CrudRepository, which provides a default implementation for the basic find, save, and delete methods — so we don’t care about defining implementation classes for them.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>security</category>
      <category>database</category>
      <category>serverless</category>
      <category>spring</category>
    </item>
    <item>
      <title>Truly there is no difference in implementation. Integrating Spring with Jersey and integrating Jersey with Spring </title>
      <dc:creator>Hamdamboy</dc:creator>
      <pubDate>Tue, 07 Apr 2020 02:54:55 +0000</pubDate>
      <link>https://dev.to/urunov/truly-there-is-no-difference-in-implementation-integrating-spring-with-jersey-and-integrating-jersey-with-spring-m2k</link>
      <guid>https://dev.to/urunov/truly-there-is-no-difference-in-implementation-integrating-spring-with-jersey-and-integrating-jersey-with-spring-m2k</guid>
      <description>&lt;p&gt;More interesting and arguably references are Jersey and Spring, especially  integrating Jersey to Spring, or differ. This article we might response that curiosity. &lt;a href="https://github.com/Hamdambek/SpringBoot-Projects-FullStack/tree/master/Part-4%20Spring%20Boot%20REST%20API" rel="noopener noreferrer"&gt;Catch up source code which we implemented Spring and Jersey.&lt;/a&gt; &lt;br&gt;
    Really there is no difference in implementation. Integrating Spring with&lt;br&gt;
    Jersey and integrating Jersey with Spring mean the same thing as far as code &lt;br&gt;
    is concerned. &lt;/p&gt;

&lt;h1&gt;
  
  
  What is Jersey, stands for...?
&lt;/h1&gt;

&lt;p&gt;Briefly inform about Jersey: The Jersey RESTful Web Services framework is open source, production quality, framework for developing RESTful Web Services in Java that provides support for JAX-RS APIs and serves as a JAX-RS (JSR 311 &amp;amp; JSR 339) Reference Implementation.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is JAX-RS...?
&lt;/h1&gt;

&lt;p&gt;Java API for RESTful Web Services (JAX-RS) is a Java programming language API specification that provides support in creating web services according to the Representational State Transfer (REST) architectural pattern.&lt;br&gt;
JAX-RS uses annotations to simplify the development and deployment of web service clients and endpoints. JAX-RS is an official part of Java EE.&lt;/p&gt;

&lt;p&gt;This article assumes you understand Jersey, and are thinking about integrating Spring into your Jersey application. Figure-1. Three-tier application architecture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fuqvr69zi0mlvh2eh8459.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fuqvr69zi0mlvh2eh8459.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Figure-1. Three-tier application architecture.&lt;/p&gt;

&lt;p&gt;In this example, the business layer and persistence layer may seem redundant, but in a real application, the service layer also handles the business logic of the domain, not just a simple “find data”, but also “do manipulate data”. The persistence layer should only be concerned with database interactions, and not with any business logic.&lt;br&gt;
In a REST application, there is no presentation layer. But does that mean that this architecture doesn’t apply to REST applications? Absolutely not. We should still adhere to this separation of concerns in REST applications. It is just good design.&lt;br&gt;
With Spring, its REST layer is implemented in its MVC framework. The MVC framework is widely know for its MVC capabilities with the use of controllers. But with a little tweaking of the controllers and the annotations used, the controllers can easily become a REST controller, where instead of return models and views, you are return RESTful representation objects. More valuable information adhere Figure-2. A multi-layered architecture, based on the “Law of Demeter". &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fa9ajrzoiacc8tycm10t7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fa9ajrzoiacc8tycm10t7.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Figure-2. Multi-layer architecure.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the first layer is the REST support implemented with Jersey, has the role of a facade and delegates the logic to the business layer&lt;/li&gt;
&lt;li&gt;the business layer is where the logic happens&lt;/li&gt;
&lt;li&gt;the data access layer is where the communcation with the pesistence storage (in our case the MySql database) takes place&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://github.com/Hamdambek/SpringBoot-Projects-FullStack/tree/master/Part-4%20Spring%20Boot%20REST%20API" rel="noopener noreferrer"&gt;Source code:&lt;/a&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; @SpringBootApplication
 public class JerseyApplication implements WebApplicationInitializer {

  public static void main(String[] args) {
    SpringApplication.run(JerseyApplication.class, args);
  }

  @Override
 public void onStartup(ServletContext sc) throws ServletException {
    sc.setInitParameter("contextConfigLocation", "noop");

    AnnotationConfigWebApplicationContext context
            = new AnnotationConfigWebApplicationContext();
    context.register(SpringConfig.class);
    sc.addListener(new ContextLoaderListener(context));
    sc.addListener(new RequestContextListener());
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Reference:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://psamsotha.github.io/jersey/2015/10/19/why-use-spring-with-jersey.html#mavenDeps" rel="noopener noreferrer"&gt;WHY AND HOW TO USE SPRING WITH JERSEY?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.javacodegeeks.com/2014/08/tutorial-rest-api-design-and-implementation-in-java-with-jersey-and-spring.html" rel="noopener noreferrer"&gt;Tutorial – REST API design and implementation in Java with Jersey and Spring&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>rest</category>
      <category>sping</category>
      <category>jersey</category>
      <category>java</category>
    </item>
    <item>
      <title>Cognitive Control Annotations in Spring Boot </title>
      <dc:creator>Hamdamboy</dc:creator>
      <pubDate>Tue, 31 Mar 2020 03:18:18 +0000</pubDate>
      <link>https://dev.to/urunov/cognitive-control-annotations-in-spring-boot-23io</link>
      <guid>https://dev.to/urunov/cognitive-control-annotations-in-spring-boot-23io</guid>
      <description>&lt;h2&gt;
  
  
  Cognitive Control Annotations in Spring boot allows to annotation(s) with appropriate dependency injection.
&lt;/h2&gt;

&lt;p&gt;The article mainly focus on Cognitive Control of annotation(s).  Especially, @Annotation (@-at using widely in annotation in Spring), and practical implementation in real project. Indeed, you may use free open source here github.&lt;br&gt;
&lt;a href="https://github.com/Hamdambek/SpringBoot-Projects-FullStack/tree/master/Part-3%20Spring%20Boot%20Annotations"&gt;Just click it&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Indeed, we’ll explore list of annotations in Spring in down below.&lt;/p&gt;

&lt;p&gt;@SpringBootApplication (see Figure-1. Annotation in Spring Boot)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Annotation indicates a configuration class that declares one or more @Bean methods, and also trigger auto-configuration and component scanning. &lt;/li&gt;
&lt;li&gt; This is a convenience annotation that is equivalent to declaring 
@Configuration, @EnableAutoConfiguration, and @ComponentScan. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YHs0BL0i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/b7sv02scz673iuay0mn5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YHs0BL0i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/b7sv02scz673iuay0mn5.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Figure-1. Annotation in Spring Boot.&lt;/p&gt;

&lt;p&gt;More information in the annotation below in that side.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;@EnableAutoConfiguration - enable Spring Boot's auto-configuration mechanism&lt;/li&gt;
&lt;li&gt;@CompoenetScan - enable @Component scan on the package where the application is located.&lt;/li&gt;
&lt;li&gt;@Configuration - allow to register extra beans in the context or import additional configuration classes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In addition, we will annotate a method of a bean with @Async will make it execute in a separate thread i.e. the caller will not wait for the completion of the called method. (see Figure-2).&lt;br&gt;
If you have been already working on Spring or Spring Boot Application and you have a requirement to use an Asynchronous mechanism, then these below three quick steps will help to set up.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Oaza09XS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/qzb9e15bvv7r0z4y56gu.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Oaza09XS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/qzb9e15bvv7r0z4y56gu.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Figure-2. Async Annotation to a method.&lt;/p&gt;

&lt;p&gt;Note that Spring uses the Jackson JSON library to convert GitHub’s JSON response into a User object. The @JsonIgnoreProperties annotation signals Spring to ignore any attributes not listed in the class. This makes it easy to make REST calls and produce domain objects.&lt;br&gt;
In this article, we are only grabbing the name and the blog URL for demonstration purposes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xFIVEF5---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kww5eia63s4jlaey6nvy.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xFIVEF5---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kww5eia63s4jlaey6nvy.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Figure-3 Architecture Structure of Class. (see more code in &lt;a href="https://github.com/Hamdambek/SpringBoot-Projects-FullStack/tree/master/Part-3%20Spring%20Boot%20Annotations"&gt;github&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;What we will build in here? &lt;/p&gt;

&lt;p&gt;Indeed, We’ll build a lookup service that queries GitHub user information and retrieves data through GitHub’s API. One approach to scaling services is to run expensive jobs in the background and wait for the results using Java’s CompletableFuture interface. Java’s CompletableFuture is an evolution of the regular Future. It makes it easy to pipeline multiple asynchronous operations merging them into a single asynchronous computation.&lt;/p&gt;

&lt;p&gt;The GitHubLookupService class uses Spring’s RestTemplate to invoke a remote REST point (api.github.com/users/), and then convert the answer into a User object. Spring Boot automatically provides a RestTemplateBuilder that customizes the defaults with any auto-configuration bits (i.e. MessageConverter).&lt;br&gt;
The findUser method is flagged with Spring’s @Async annotation, indicating it will run on a separate thread. The method’s return type is CompletableFuture instead of User, a requirement for any asynchronous service. This code uses the completedFuture method to return a CompletableFuture instance which is already completed with a result of the GitHub query.&lt;/p&gt;

&lt;p&gt;Running Application &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Two ways we can start the standalone Spring boot application.
We are using maven so just run the application using ./mvnw spring-boot:run. Or you can build the JAR file with ./mvnw clean package. Then you can run the JAR file:&lt;/li&gt;
&lt;li&gt;Below diagram shows and how to run spring boot application from IDE - right click - run as - SpringbootAsyncApplication.main() method as a standalone Java class. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In addition, a list all annotation and brief explanation: &lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Autowired
@Qualifier("laptop") this may use component regarding laptop name... (ex&amp;gt;= 
Component("lap1")
@autoconfiguration
-------------------------
@Bean
@Configuration
@Control 
@Component
@ComponentScan
-------------------------
@Data ---&amp;gt; at the class level is provided by Lombok and tells Lombok to 
generate all of those missing methods. 
@DeleteMapping
-------------------------
@EnableAutoConfiguration
@Entity
@EnableWebSecurity
------------------------
@ManyToMany (targetEntity=Ingredient.class_)
@ManyToOne
------------------------
@NotNull 
@NotBlank
@NoArgsConstructor ( access=AccessLevel.PRIVATE, force=true)
------------------------
@GetMapping
-------------------------
@Service
@SpringBootApplication
@SpringBootTest
@Size
@Slf4j - Simple Logging Facade for Java. Lombok's @Slf4j annotation to create 
a free SLF4J Logger object at runtime.
@SessionAttributes
@SuppressWarnings("")
-------------------------
@PostMapping
@PutMapping
@PatchMapping
@PrePersist
@Profile
-------------------------
@RunWith(SpringRunner.class)---&amp;gt; prividing a test runner that guides JUnit in 
running a test. Plugin to JUnit to provide custom.
@Repository
@RequestMapping
@RequiredArgsConstructor
-- ----------------------
@Table
------------------------ 
@Query("")
------------------------
@Valid
------------------------
@WebMvcTest  - set up Spring support for testing Spring MVC. Although it 
could be made to start a server, mocking the mechanics of Spring MVC.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Likewise, you may use API github, just free use it. &lt;a href="https://api.github.com/"&gt;GithubAPI&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>java</category>
      <category>management</category>
      <category>spring</category>
    </item>
    <item>
      <title>Twitter, SMS Services: Spring Boot possible XML Configuration </title>
      <dc:creator>Hamdamboy</dc:creator>
      <pubDate>Mon, 30 Mar 2020 02:33:10 +0000</pubDate>
      <link>https://dev.to/urunov/twitter-sms-services-spring-boot-possible-xml-configuration-2p9m</link>
      <guid>https://dev.to/urunov/twitter-sms-services-spring-boot-possible-xml-configuration-2p9m</guid>
      <description>&lt;p&gt;The system configuration is important building real project and interoperable dependency injection. This article we will quickly discuss how to develop a simple Spring boot 2 application using XML based Spring configuration. Indeed, Twitter, SMS, Email systems are proceeding in Java Spring implementation and using XML. Indeed, as usual open source in the &lt;a href="https://github.com/Hamdambek/SpringBoot-Projects-FullStack/tree/master/Part-2%20Spring%20Boot%20Configuration"&gt;github&lt;/a&gt;, just use it.&lt;/p&gt;

&lt;p&gt;In this example, we don't use either Annotation-based configuration or Java-based configuration, we only use XML based configuration to create and configure beans.&lt;br&gt;
Spring provides a @ImportResource annotation is used to load beans from an applicationContext.xml file into an Application Context.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;@ImportResource({"classpath*:applicationContext.xml"})&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;we are creating a simple message processing spring boot application. Here we are sending a message using different services like SMSService, TwitterService, and EmailService. We will configure message service beans in applicationContext.xml file and we will load beans using @ImportResource annotation as (see more source explanation github). Figure -1. XML configuration in Spring Boot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3EMHO-Q3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xfid0mjullkkjpzrx7d8.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3EMHO-Q3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xfid0mjullkkjpzrx7d8.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
                    Figure-1. XML Configuration in Spring Boot&lt;/p&gt;

&lt;h1&gt;
  
  
  The applicationContext.xml File
&lt;/h1&gt;

&lt;p&gt;There is simplify source code in applicationContext.xml file:&lt;br&gt;
        &amp;gt; * Source code&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
      &amp;lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:context="http://www.springframework.org/schema/context"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans.xsd
      http://www.springframework.org/schema/context
      http://www.springframework.org/schema/context/spring-context.xsd"&amp;gt;
      &amp;lt;bean id ="emailService"
      class="spring.configure.service.EmailService" /&amp;gt;
      &amp;lt;bean id="sMSService"
      class="spring.configure.service.SmsService" /&amp;gt;
      &amp;lt;bean id="twitterService"
      class="spring.configure.service.TwitterService" /&amp;gt;
      &amp;lt;bean id="messageProcessor"
      class="spring.configure.service.MessageProcessorImpl"&amp;gt;
      &amp;lt;property name="messageService" ref="twitterService"&amp;gt;&amp;lt;/property&amp;gt;
      &amp;lt;/bean&amp;gt;
      &amp;lt;/beans&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The essential point is you may update inside XML source code &amp;lt;bean id ="emailService". in your main folder address and work-space. &lt;/p&gt;

</description>
      <category>spring</category>
      <category>microservices</category>
      <category>java</category>
      <category>database</category>
    </item>
    <item>
      <title>Spring Boot: Auto Configuration and Projects</title>
      <dc:creator>Hamdamboy</dc:creator>
      <pubDate>Thu, 19 Mar 2020 07:03:11 +0000</pubDate>
      <link>https://dev.to/urunov/spring-boot-basics-and-fundamentals-with-projects-5967</link>
      <guid>https://dev.to/urunov/spring-boot-basics-and-fundamentals-with-projects-5967</guid>
      <description>&lt;h1&gt;
  
  
  What is the Spring Boot?
&lt;/h1&gt;

&lt;p&gt;Spring Boot is basically an extension of the Spring framework which eliminated the boilerplate configurations required for setting up a Spring application.&lt;br&gt;
Indeed, you may find source code github, &lt;a href="https://github.com/Hamdambek/SpringBoot-Projects"&gt;open source&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;It takes an opinionated view of the Spring platform which paved the way for a faster and more efficient development eco-system.&lt;/p&gt;

&lt;p&gt;These components, or beans, are wired together inside the Spring application context to make a complete application,much like bricks, mortar, timber, nails, plumbing, and wiring are bound together to make a house.&lt;/p&gt;

&lt;p&gt;The act of wiring beans together is based on a pattern known as # dependency injection (DI). Rather than have components create and maintain the lifecycle of other beans that they depend on, a dependency-injected application relies on a separate entity (the container) to create and maintain all components and inject those into the beans that need them. This is done typically through constructor arguments or property accessor methods. &lt;a href="https://github.com/Hamdambek/Spring-in-Action-5-Book-All-Projects/tree/master/InAddition"&gt;More information you may download Spring&lt;/a&gt;, and Annotation resource.&lt;/p&gt;

&lt;h1&gt;
  
  
  Spring Boot Primary Goals
&lt;/h1&gt;

&lt;p&gt;Provide a radically faster and widely accessible getting-started experience for all Spring development. Be opinionated out of the box but get out of the way quickly as requirements start to diverge from the defaults.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fY1EH6LC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pu5hes3optepsgv6aln2.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fY1EH6LC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pu5hes3optepsgv6aln2.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Provide a range of non-functional features that are common to large classes of projects (such as embedded servers, security, metrics, health checks, and externalized configuration). Absolutely no code generation and no requirement for XML configuration.&lt;br&gt;
Key Spring Boot features. Let me a list of a few key features of the Spring boot and we will discuss each:&lt;/p&gt;

&lt;h1&gt;
  
  
  KEY FEATURES briefly
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;(Step-1)  Spring Boot starters&lt;/li&gt;
&lt;li&gt;(Step-2)  Spring Boot auto-configuration&lt;/li&gt;
&lt;li&gt;(Step-3)  Elegant configuration management&lt;/li&gt;
&lt;li&gt;(Step-4)  Spring Boot actuator&lt;/li&gt;
&lt;li&gt;(Step-5)  Easy-to-use embedded servlet container support&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  (Step-1)  Spring Boot starters
&lt;/h1&gt;

&lt;p&gt;The Spring Initialiser is both a browser-based web application and a REST API, which can produce a skeleton Spring project structure that you can flesh out with whatever functionality you want. Several ways to use Spring Initialiser follow:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* From the web application at http://start.spring.io
* From the command line using the curl command
* From the command line using the Spring Boot command-line interface
* When creating a new project with Spring Tool Suite
* When creating a new project with IntelliJ IDEA
* When creating a new project with NetBeans
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lojopZEW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cl1jddxsmqvf7zzoh5ci.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lojopZEW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cl1jddxsmqvf7zzoh5ci.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For instance, the spring-boot-starter-data-jpa starter module includes all the dependencies required to use Spring Data JPA, along with Hibernate library dependencies, as Hibernate is the most commonly used JPA implementation.&lt;/p&gt;

&lt;h1&gt;
  
  
  (Step-2)  Spring Boot auto-configuration
&lt;/h1&gt;

&lt;p&gt;Spring comes with a powerful web framework known as Spring MVC. At the center of Spring MVC is the concept of a controller, a class that handles requests and responds with information of some sort. &lt;br&gt;
Spring Boot takes an opinionated view of the application and configures various components automatically, by registering beans based on various criteria. The criteria can be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Availability of a particular class in a classpath&lt;/li&gt;
&lt;li&gt;Presence or absence of a Spring bean&lt;/li&gt;
&lt;li&gt;Presence of a system property&lt;/li&gt;
&lt;li&gt;An absence of a configuration file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0F__7QAn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pugnnolzc0aftyzc51rm.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0F__7QAn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pugnnolzc0aftyzc51rm.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.infoq.com/news/2017/12/servlet-reactive-stack/"&gt;Spring MVC &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example, if you have the spring-webmvc dependency in your classpath, Spring Boot assumes you are trying to build a SpringMVC-based web application and automatically tries to register Dispatcher Servlet if it is not already registered. If you have any embedded database drivers in the classpath, such as H2 or HSQL, and if you haven’t configured a DataSource bean explicitly, then Spring Boot will automatically register a DataSource bean using in-memory database settings.&lt;/p&gt;

&lt;h1&gt;
  
  
  (Step-3)  Elegant configuration management
&lt;/h1&gt;

&lt;p&gt;Spring supports externalizing configurable properties using the @PropertySource configuration.&lt;a href="https://www.javaguides.net/2018/09/getting-started-with-spring-boot.html"&gt;More information you may get&lt;/a&gt; .&lt;/p&gt;

&lt;p&gt;Spring Boot takes it even further by using the sensible defaults and powerful type-safe property binding to bean properties. Spring Boot supports having separate configuration files for different profiles without requiring many configurations.&lt;/p&gt;

&lt;h1&gt;
  
  
  (Step-4)  Spring Boot actuator
&lt;/h1&gt;

&lt;p&gt;The Spring Boot actuator provides a wide variety of such production-ready features without requiring developers to write much code. Some of the Spring actuator features are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can view the application bean configuration details&lt;/li&gt;
&lt;li&gt;Can view the application URL mappings, environment details, and configuration parameter values&lt;/li&gt;
&lt;li&gt;Can view the registered health check metrics&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  (Step-5)  Easy-to-use embedded servlet container support
&lt;/h1&gt;

&lt;p&gt;Easy to use embedded servlet container supports while building web applications, you need to create WAR type modules and then deploy them on external servers like Tomcat, WildFly, etc. But by using Spring Boot, you can create a JAR type module and embed the servlet container in the application very easily so that the application will be a self-contained deployment unit. Also, during development, you can easily run the Spring Boot JAR type module as a Java application from the IDE or from the command-line using a build tool like Maven or Gradle.&lt;br&gt;
Servlet Containers&lt;br&gt;
Servlet vs. Reactive &lt;a href="https://www.infoq.com/news/2017/12/servlet-reactive-stack/"&gt;more details&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  How to handle Default Context Path
&lt;/h1&gt;

&lt;p&gt;How to Change the Default Context Path?&lt;br&gt;
There are several ways to change the default context path.&lt;br&gt;
Using application.properties File&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;/src/main/resources/application.properties
&amp;gt; server.port=8080
&amp;gt; server.servlet.context-path=/springboot2webapp&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By default, the context path is “/”. To change the context path, override and update server.servlet.context-path properties. The following examples update the context path from / to /springboot2webapp or &lt;/p&gt;

&lt;p&gt;&lt;a href="http://localhost:8080/springboot2webapp"&gt;http://localhost:8080/springboot2webapp&lt;/a&gt; Just like many other configuration options, the context path in Spring Boot can be changed by setting a property, i.e., server.servlet.context-path.&lt;/p&gt;

</description>
      <category>microservices</category>
      <category>spring</category>
      <category>java</category>
      <category>security</category>
    </item>
  </channel>
</rss>
