You can absolutely do that, just remove the @RequestParam
annotation, Spring will cleanly bind your request parameters to your class instance:
public @ResponseBody List<MyObject> myAction(
@RequestParam(value = "page", required = false) int page,
MyObject myObject)
More Related Contents:
- Using env variable in Spring Boot’s application.properties
- Spring MVC @PathVariable getting truncated
- How to upload a file and JSON data in Postman?
- When using Spring Security, what is the proper way to obtain current username (i.e. SecurityContext) information in a bean?
- Difference between spring @Controller and @RestController annotation
- Spring Boot Adding Http Request Interceptors
- Using GZIP compression with Spring Boot/MVC/JavaConfig with RESTful
- Return generated pdf using spring MVC
- Loading context in Spring using web.xml
- How to disable spring security for particular url
- Spring – Redirect after POST (even with validation errors)
- Spring 3 MVC: one-to-many within a dynamic form (add/remove on create/update)
- Binding a list in @RequestParam
- How to configure embedded Tomcat integrated with Spring to listen requests to IP address, besides localhost?
- How to enable HTTP response caching in Spring Boot
- spring mvc rest service redirect / forward / proxy
- How to Implement HTTP byte-range requests in Spring MVC
- Strange Jackson exception being thrown when serializing Hibernate object
- Spring MVC Controller: Redirect without parameters being added to my url
- How to add bean instance at runtime in spring WebApplicationContext?
- Refreshing static content with Spring MVC and Boot
- How to handle MaxUploadSizeExceededException
- HTTP Status 406. Spring MVC 4.0, jQuery, JSON
- Trying to use Spring Boot REST to Read JSON String from POST
- Using RestTemplate, how to send the request to a proxy first so I can use my junits with JMeter?
- Spring Boot @Async method in controller is executing synchronously
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- How I create an error handler (404, 500…) in Spring Boot/MVC
- Spring-MVC 406 Not Acceptable instead of JSON Response
- What does the @Valid annotation indicate in Spring?