In our article Spring Boot REST API – Log Incoming HTTP Requests we have learned how to log incoming HTTP requests in our Spring Boot REST API application. Here we will learn how we can log both HTTP Requests and Responses in our Spring Boot REST API application. In this article, we will write our own custom logging solution by ... Read More »
Spring Boot REST API – Log Incoming HTTP Requests
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
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 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
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
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 »
JAVA mails API using IMAP- Reading mails based on UID that too without changing seen/unseen status at mail server send
JAVA mails API using IMAP- Reading mails based on UID that too without changing seen/unseen status at mail server send Here I would like to share a scenario where I have to process mails using JAVA mails API based on UID and that too without changing seen/unseen status at mail server end. Now to start reading mails based on UID ... Read More »
How to create Android Menus
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
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
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 »
Jkoder.com Tutorials, Tips and interview questions for Java, J2EE, Android, Spring, Hibernate, Javascript and other languages for software developers