Spring Boot REST API – Log Incoming HTTP Requests

spring

For our spring boot RESTFul API application, it becomes essential to log all the API requests and responses to our debugging purpose. We came across lots of different approaches to solve the logging problem. We will discuss here CommonsRequestLoggingFilter which is a spring built-in request logging solution, which we can configure by just adding one bean and enabling some of ... Read More »

How to document Controller and Model class using Swagger2 in Spring Boot REST project

swagger

In our article Integrate Swagger2 with Spring Boot REST API, we learned to integrate Swagger2 in our Spring Boot REST application. Here in this article, we will learn how to document the Controller and Model class of our Spring Boot project using annotations provided by Springfox Swagger 2. Controller Class Documentation To document our controller class we will use @Api, ... Read More »

Integrate Swagger2 with Spring Boot REST API

swagger

Swagger 2 makes the Spring Boot REST API much easier to describe and document. And Swagger2 is very easy to integrate with the Spring Boot application. Here we will learn this step by step and use Swagger 2 to generate Spring Boot REST API project documentation. Adding the Maven Dependencies My pom.xml, where I added the below dependencies to integrate ... Read More »

How to Disabled Swagger-UI in Production in Spring Boot Project

swagger

I have a Spring Boot REST API application and I integrated Swagger for documentation and also using it to test API with Swagger-UI. Now my task was to disable the Swagger-UI on our production environment (public domain) and enable it in our dev environment which was on private IP. APPROACH – 1 With Swagger vr-3.0.0 we can add springfox.documentation.enabled=false/true in ... Read More »

CORS Filter for J2EE Application

j2ee

CORS (Cross-origin resource sharing) helps in making Javascript based AJAX request from one domain to another, requesting domain is different from the domain where the request is made. This type of request is by default forbidden at the browser level and if this type of requet is made without proper settings, they will result in some origin security policy error. ... Read More »

How to create Android Menus

android

Options Menu The options menu is created when the user presses the menu button while the Activity is active.Step 1 – Creating the menu XML Step 2 – Showing the menu (implemented in Activity class) Step 3 – Listening to user choice (implemented in Activity class) Step 4 – optional: updating the menu items dynamically. Opening the options menu by ... Read More »

Android Questions & Answers for Experienced

android

Q. What is assert? Where will you use it? – Assertion is a statement in java. It can be used to test your assumptions about the program. While executing assertion, it is believed to be true. If it fails, JVM will throw an error named AssertionError. It is mainly used for testing purpose.for Exampleassert value>=18:” Not valid”;Q. How do you ... Read More »

Essential Android Interview Question & Answer

android

Q.1 There are four Java classes related to the use of sensors on the Android platform. List them and explain the purpose of each. – The four Java classes related to the use of sensors on the Android platform are: Sensor: Provides methods to identify which capabilities are available for a specific sensor. SensorManager: Provides methods for registering sensor event ... Read More »