1. Home
  2. /
  3. Spring-boot
  4. /
  5. Spring Boot Query Param Example

Spring Boot Query Param Example - Spring-boot Typing CST Test

Loading…

Spring Boot Query Param Example — Spring-boot Code

Greets user using query parameters.

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.*;

@SpringBootApplication
public class GreetApplication {
	public static void main(String[] args) {
		SpringApplication.run(GreetApplication.class, args);
	}
}

@RestController
class GreetController {
	@GetMapping("/greet")
	public String greet(@RequestParam(defaultValue="Guest") String name) {
		return "Hello " + name;
	}
}

Spring-boot Language Guide

Spring Boot is a Java-based framework that simplifies building production-ready Spring applications. It provides convention-over-configuration, embedded servers, and production-grade features for microservices and web applications.

Primary Use Cases

  • ▸RESTful API development
  • ▸Microservices architecture
  • ▸Enterprise backend systems
  • ▸Web applications with Spring MVC
  • ▸Integration with databases and messaging systems

Notable Features

  • ▸Embedded web servers for standalone deployment
  • ▸Auto-configuration to reduce boilerplate
  • ▸Production-ready metrics, health checks, and logging
  • ▸Spring ecosystem integration (Security, Data, Batch)
  • ▸Opinionated defaults with override options

Origin & Creator

Spring Boot was created by Pivotal Software (now part of VMware) in 2014 to simplify Spring framework development and deployment.

Industrial Note

Spring Boot is preferred in enterprise, cloud-native, and microservices applications where scalability, maintainability, and rapid development are critical.

More Spring-boot Typing Exercises

Spring Boot Simple Counter APISpring Boot Hello World APISpring Boot JSON EchoSpring Boot Path Variable ExampleSpring Boot Async Endpoint ExampleSpring Boot Custom 404 ResponseSpring Boot Combined Routes ExampleSpring Boot Health Check Endpoint

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher