Posts

Showing posts from December, 2020

Swagger 2 dependency in Spring Boot

Image
Hi folks, hope i found you well in these tough time. In this particular blog i am going to implement Swagger 2 into a spring boot web application. Table of content What is swagger? Implementing  a spring boot API using swagger. Swagger has a vast set of tools for APIs development. Swagger is a tool to achieve the following Develop APIs Interact with APIs Document APIs The third one i.e. documenting APIs given swagger a lots of popularity. It is an excellent tool to document APIs. The most popular tool to do the same using something called swagger UI. In this blog we are focusing on the third one. We are going to implement a spring boot APIs and it's documentation using swagger UI. But there are some of the questions that should be answered before diving in deeper. Why we need a tools to documenting an API? The answer to above question is pretty much simpler, when some one build an API and some other user is going to consume that particular API, then consumer need to know all the en

Logger in SpringBoot

Image
                    Hello geeks, here I came up with another interesting blog on Logger in java spring boot. To understand the logger we need their requirement first.                                In our application there are some situations, where our code breaks or behaves abnormally, to understand this we need some of the trace of code. Mean from where and why this abnormal or code break happens. So, we need to track or print out the class name, method name with line number from where the issue occurred.           So, all in all we just need a console out put mentioning the exact issue with class level and method level details with line number. We, can use a simple system.out.println but it has no any flexibility and configuration on application level, Like filtering the log level, filtering the packaging etc. The logging facilities are there on JDK since 1.0 under java.utils.logging packag in Logger class. We get the hold of this static class's object using Logger.getLogger(Cl

Spring boot security basics

Image
Hello geeks, here i came up with another blog series on spring security, Where I am going to explore some of the basic concepts behind the spring boot security as well as hands on examples.  This is going to be the first blog in this series on spring boot security, so please follow all blogs in order to better understanding of the concepts.                                                 Before we begin to deep dive into spring security, we need to under stand why we need application level security. Since we have already OS level security, server level security then why we need this application level security. The answer is pretty much self explanatory, since we are developing APIs in java, these end points are explicitly exposed to end user that's why all the already applied security on OS level and server are forcefully by passed here. So, all in all we need another application level security here. For this spring security came to the rescue here.      In real spring security is