Kayıtlar

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

Servlet

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

The Convergence of OpenJDK and the Oracle JDK

Resim
In 2018, Oracle changed the license of their JDK. Instead of a single JDK build available both for commercial and free users, they offered two different JDK builds: Oracle JDK (commercial), which can be used in development and testing for free, but you have pay to use it in production. Oracle Open JDK (open source), which can be used in any environment for free. JDK Builds There is only one set of source code for the JDK. It is hosted in Mercurial at OpenJDK. Anyone can take the source code, produce a build, and post it. So, Oracle created a certification process that should be used to ensure the build is valid. This certification is run by the Java Community Process, which provides a Technology Compatibility Kit (TCK or JCK as Java). If an organization produces an OpenJDK build that passes the TCK then that build can be described as "Java SE compatible". The most popular and famous builds are distributed by Red Hat, Azul and community-led Adopt OpenJDK.