DEV Community

V I N O T H
V I N O T H

Posted on

2 2 2 2 2

Spring Boot,Annotation

1.what is Spring Boot?
Spring Boot is a framework built on top of Spring Framework that simplifies the development of Java-based web applications and microservices. It eliminates the need for complex configurations and allows developers to quickly build and deploy applications with minimal setup.

2.key points of Spring
Spring Boot – Key Points πŸš€
βœ… Built on Spring Framework – Simplifies Java web and microservices development.
βœ… Auto-configuration – Reduces manual setup, configures beans automatically.
βœ… Embedded Servers – Comes with Tomcat, Jetty, or Undertow, no need for external servers.
βœ… Spring Boot Starters – Pre-configured dependencies for faster development.
βœ… Microservices Support – Ideal for cloud-based applications.
βœ… Spring Boot Actuator – Provides monitoring, metrics, and health checks.
βœ… Production-Ready – Has logging, exception handling, and security features.
βœ… Spring Initializr – Generates a project setup quickly (start.spring.io).
βœ… Simplified Deployment – Can be packaged as a JAR and run independently.

Example program

package com.example.demo;

import org.springframework.stereotype.Component;

@Component 
public class Engine {

//  String fuel1, fuel2;
//  public Engine(String fuel1, String fuel2) 
//  {
//      this.fuel1 = fuel1;
//      this.fuel2 = fuel2;
//  }

    public void Start() {
        System.out.println("Engine Started");
    }
}

Enter fullscreen mode Exit fullscreen mode

package com.example.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Car {

@Autowired
Engine engine;

public static void main(String[] args) {

    // Car maruti = new Car();
    // maruti.drive();
}

public void drive() {
    // TODO Auto-generated method stub
    // Engine engine = new Engine("Petrol");
    engine.Start();

}
Enter fullscreen mode Exit fullscreen mode

}

package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext cac= 
        SpringApplication.run(DemoApplication.class, args);
        Car Bezn = cac.getBean(Car.class);
        Bezn.drive();
    }

}

Enter fullscreen mode Exit fullscreen mode

Output

. ____ _ __ _ _
/\ / ' __ _ ()_ __ __ _ \ \ \ \
( ( )_ | '_ | '| | ' \/ ` | \ \ \ \
\/ _)| |)| | | | | || (| | ) ) ) )
' |__| .|| ||| |_, | / / / /
=========||==============|_/=////

:: Spring Boot :: (v3.4.4)

2025-04-03T18:18:10.927+05:30 INFO 10662 --- [demo] [ restartedMain] com.example.demo.DemoApplication : Starting DemoApplication using Java 21.0.6 with PID 10662 (/home/neelakandan/Documents/workspace-spring-tool-suite-4-4.29.1.RELEASE/demo/target/classes started by neelakandan in /home/neelakandan/Documents/workspace-spring-tool-suite-4-4.29.1.RELEASE/demo)
2025-04-03T18:18:10.930+05:30 INFO 10662 --- [demo] [ restartedMain] com.example.demo.DemoApplication : No active profile set, falling back to 1 default profile: "default"
2025-04-03T18:18:10.973+05:30 INFO 10662 --- [demo] [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2025-04-03T18:18:10.973+05:30 INFO 10662 --- [demo] [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2025-04-03T18:18:11.812+05:30 INFO 10662 --- [demo] [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8080 (http)
2025-04-03T18:18:11.824+05:30 INFO 10662 --- [demo] [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2025-04-03T18:18:11.824+05:30 INFO 10662 --- [demo] [ restartedMain] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.39]
2025-04-03T18:18:11.850+05:30 INFO 10662 --- [demo] [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2025-04-03T18:18:11.851+05:30 INFO 10662 --- [demo] [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 876 ms
2025-04-03T18:18:12.163+05:30 INFO 10662 --- [demo] [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2025-04-03T18:18:12.183+05:30 INFO 10662 --- [demo] [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8080 (http) with context path '/'
2025-04-03T18:18:12.192+05:30 INFO 10662 --- [demo] [ restartedMain] com.example.demo.DemoApplication : Started DemoApplication in 1.585 seconds (process running for 1.88)
Engine Started
Enter fullscreen mode Exit fullscreen mode

Quadratic AI

Quadratic AI – The Spreadsheet with AI, Code, and Connections

  • AI-Powered Insights: Ask questions in plain English and get instant visualizations
  • Multi-Language Support: Seamlessly switch between Python, SQL, and JavaScript in one workspace
  • Zero Setup Required: Connect to databases or drag-and-drop files straight from your browser
  • Live Collaboration: Work together in real-time, no matter where your team is located
  • Beyond Formulas: Tackle complex analysis that traditional spreadsheets can't handle

Get started for free.

Watch The Demo πŸ“Šβœ¨

Top comments (0)

Jetbrains Survey

Calling all developers!

Participate in the Developer Ecosystem Survey 2025 and get the chance to win a MacBook Pro, an iPhone 16, or other exciting prizes. Contribute to our research on the development landscape.

Take the survey

πŸ‘‹ Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay