As explained in the documentation, by using an @RequestParam
annotation:
public @ResponseBody String byParameter(@RequestParam("foo") String foo) {
return "Mapped by path + method + presence of query parameter! (MappingController) - foo = "
+ foo;
}
More Related Contents:
- Passing multiple variables in @RequestBody to a Spring MVC controller using Ajax
- what does it mean when they say http is stateless
- How to Implement HTTP byte-range requests in Spring MVC
- HTTP request compression
- How do you write to a folder on an SD card in Android?
- How are Spring Data repositories actually implemented?
- How to respond with HTTP 400 error in a Spring MVC @ResponseBody method returning String?
- What is this spring.jpa.open-in-view=true property in Spring Boot?
- Spring MVC – How to get all request params in a map in Spring controller?
- How to serve .html files with Spring
- How to inject a Map using the @Value Spring Annotation?
- How to manage REST API versioning with spring?
- How to manage exceptions thrown in filters in Spring?
- Is it possible to unproxy a Spring bean?
- Could not commit JPA transaction: Transaction marked as rollbackOnly
- how to display custom error message in jsp for spring security auth exception
- Spring JpaRepository – Detach and Attach entity
- SpringBoot – BeanDefinitionOverrideException: Invalid bean definition
- Rollback transaction after @Test
- How do I properly do a background thread when using Spring Data and Hibernate?
- Spring Boot application.properties value not populating
- How to forward large files with RestTemplate?
- How to map a JSON column with H2, JPA, and Hibernate
- Async not working on controller’s abstract super class method
- Spring @RequestBody containing a list of different types (but same interface)
- Autowire a bean within Spring’s Java configuration
- How to persist LocalDate with JPA?
- Reload or refresh a Spring application context inside a test method?
- NoSuchFieldError when trying to run a jUnit test with Spring
- How to handle DataIntegrityViolationException in Spring?