Nisan, 2019 tarihine ait yayınlar gösteriliyor

Configuring Spring Boot Application with Maven

You can build and manage your Spring Boot applications with Maven or Gradle. In this article we will explore the basics of maven configuration for Spring Boot applications. When we generate a Spring Boot application with Spring Initializr or Spring Boot CLI, a template Spring Boot project is generated for us having the selected dependencies. Let's examine the sections of the generated pom.xml. 1.Parent Pom In the heart of Spring Boot is inheriting the defaults from predefined configurations and that is the usage of starter pom files. A starter pom file includes convenient dependencies and versions in sync for your application; and when you import that starter you would automatically have the dependencies defined in that starter pom file. <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.3.RELEASE</version> <relativePath/> </parent> In

Spring Components & Auto Scanning & Configuration

Spring managed beans are declared with the stereotype annotations specialized from @Component or with the @Component annotation itself. When you declare a class with @Component[+derived] annotations, that bean is detected by Spring, via component scanning or explicitly wiring, and put into the ApplicationContext. 1. Component Scanning In a Spring application, you can declare your beans manually inside the bean configuration file, but most probably, auto scanning of components is the preferred way of registering your beans into the application context. You can configure auto scanning in bean configuration file or with the annotation. 1.1 Enable Auto-Scanning in Bean Configuration File This is available since Spring 2.5: <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="ht


In Java EE world, Servlet simply is a web technology with which we can receive and handle the HTTP requests, create HTTP response and return that response back to the client. Servlet technology makes a basis for other Java web technologies on top of which other frameworks put their extensions. For example JSP, JSF, Spring MVC are such technologies which are uses Servlet technology at behind.  Servlets run on a web container such as Tomcat which provides the services on Java EE technology stack .  What is a servlet ? Servlet simply makes an object having HTTP-server functionality when its class extends HttpServlet class. A servlet is mapped to a URL to which clients request HTTP requests made to the URL is directed to the corresponding Servlet object Servlet implementation receives the request in the form of GET, POST, PUT or DELETE Servlet implementation runs a business logic and prepares an HTTP response and sends it back to the client just an HTTP server does Lifecycle of