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 »

Android Interview Questions & Answer

android

Q.1 Explain in brief about the important file and folder when you create new android application. When you create android application the following folders are created in the package explorer in eclipse which are as follows: src: Contains the .java source files for your project. You write the code for your application in this file. This file is available under ... Read More »

Using the Android NDK

android

Create a regular Android project Add a new folder to your project – <project>/JNI Write a native (C/C++) code and place the files under <project>/JNI. You should follow the JNI rules when writing your native code. Example: #include <string.h> #include <jni.h>   jstring Java_com_mypackage_helloworld_HelloWorld_getNativeString( JNIEnv* env, jobject obj ) {     return (*env)->NewStringUTF(env, "Hello World"); } Create a Android.mk file and ... Read More »