0% found this document useful (0 votes)
644 views2 pages

SpringBoot Interview Questions

Spring Boot is a framework for rapidly building applications on top of Spring. It allows developers to avoid manual configuration and includes embedded servers like Tomcat so applications can be started using "java -jar". Common annotations used in Spring Boot include @SpringBootApplication, @EnableAutoConfiguration, and @SpringBootConfiguration. Properties can be defined in the application.properties file to configure aspects of the application like the server port.

Uploaded by

Deepthi Chinnu
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
0% found this document useful (0 votes)
644 views2 pages

SpringBoot Interview Questions

Spring Boot is a framework for rapidly building applications on top of Spring. It allows developers to avoid manual configuration and includes embedded servers like Tomcat so applications can be started using "java -jar". Common annotations used in Spring Boot include @SpringBootApplication, @EnableAutoConfiguration, and @SpringBootConfiguration. Properties can be defined in the application.properties file to configure aspects of the application like the server port.

Uploaded by

Deepthi Chinnu
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1/ 2

SpringBoot

-> spring boot all about auto configuration


->whe have to use either maven or grandle build tool to work with spring boot

>>>>>What is springboot?
it is a framework for rapid application development built on top of the
spring framework
we can also say, springboot is the combination of spring framework and
embeded severs.

>>>>>Why spring is used?


to design any spring based appliaction, a developer needs to be taken
care on manual set up on
hibernate data source, entity manager, session factory,
transaction management everything.
To design all those common setup, a developer does not need to define
everything individually,
@springbootconfiguration annotation enough to manage
everything at the time of deployment

>>>>>what is the use of @springbootApplication annotation and how it works


internally?
the @springbootApplication annotation is equivalent to using
@configuration, @enableautoconfiguration
and @componentscan with their default attributes.
springboot enables the developer to use a single annotation instead of
using multiple.
But, as we know, spring provided loosely coupled features that we can
use for each individual annotation
as per our project needs.

>>>>>what are starter dependencies?


springboot starters are maven templates that contains a collection of
all relevant transitive dependencies
that are needed to start a particular functionality

>>>>>what is spring initializer? why should u use it?


one of the difficult things to start with a framework is initial setup,
particularly if u r starting from scratch and u dont have a
reference setup or project
spring intializer adressess this problemin springboot.
SI is nothing but a web application which helps you to create initial
springboot project structure
and provides maven to build ur code.

>>>>>What is spring actuator? what are its advantages?


it is one of the cool springboot feature which allows seeing inside a
running application
ex: memory management, cpu, no of threads etc
it uses HTTP endpoint or JMX beans to enable us to interaract with it
*to control this behaviour at runtime - use JMX
*by using / showdown endpoint, we can kill a springboot
application

>>>>>what is springboot CLI? what are its benefits?


The Spring Boot CLI is a command line tool that you can use
if you want to quickly develop a Spring application we can use springboot
CLI.
It lets you run Groovy scripts, means you have a familiar Java-like
syntax without so much boilerplate code.
You can also bootstrap a new project or write your own command for it.

>>>>>Common SpringBoot Annotations?


@enableautoconfiguration--used to enable auto-configuration on spring
boot application
@SpringBootApplication--used on the main class to allow it to run a jar
file
@SpringBootConfiguration--
@SpringBootTest--used to run on unit test on spring boot environment

>>>>>Difference between @SpringBootApplication and @enableautoconfiguration


annotation ?

>>>>>can we disable the default web server in the spring boot application?
the major strong point in spring is to provide flexibility to build the
application
spring provides features to disable the web server in a quick
configuration
so,yes we can use the "application.properties" to configure web
application i.e.
"spring.main.web-application-
type=none"

>>>>>can we override or replace the embedded tomcat server in spring boot?


yes, we can replace with other servers by using starter dependencies
u can use spring-boot-starter-jetty or spring-boot-starter-undertow as a
dependancy for each project as u need

>>>>>How to enable debug logging?


we can start the application with the --debug switch
we can set the logging.level.root=degug property in
application.properties file

>>>>>how to enable HTTPS/SSL support in spring boot?


this support can be added via application.properties and by adding some
entries
like server.port=8443
server.ssl.key-alias=selsigned_localhost_sslserver

>>>>>is this possible to change the port of embeded tomcat server in springboot ?
yes, u can the application.properties file to change the port.
but need to mention "server.port"

>>>>>where do u define properties in spring boot application?


u can define both application and spring boot related properties in
application.properties file
we can create file manually or can use spring initializer to create file.

You might also like