Add an HttpServletResponse
parameter to your Handler Method then call response.sendRedirect("some-url");
Something like:
@RestController
public class FooController {
@RequestMapping("/foo")
void handleFoo(HttpServletResponse response) throws IOException {
response.sendRedirect("some-url");
}
}
More Related Contents:
- Spring MVC @PathVariable with dot (.) is getting truncated
- How to get access to HTTP header information in Spring MVC REST controller?
- How to access plain json body in Spring rest controller?
- Redirect to dynamic URL in Spring MVC
- Spring MVC bean mapping to HTTP GET request parameters similar to @BeanParam
- SPRING REST: The request was rejected because no multipart boundary was found
- Spring Boot not serving static content
- Spring MVC @PathVariable getting truncated
- No WebApplicationContext found: no ContextLoaderListener registered?
- Using GZIP compression with Spring Boot/MVC/JavaConfig with RESTful
- How to use OAuth2RestTemplate?
- When use ResponseEntity and @RestController for Spring RESTful applications
- Can SpringMVC be configured to process all requests, but exclude static content directories?
- automatically add header to every response
- Send datas from html to controller in Thymeleaf?
- Spring HandlerInterceptor vs Servlet Filters
- Access Https Rest Service using Spring RestTemplate
- REST with Spring and Jackson full data binding
- SpringServletContainerInitializer cannot be cast to javax.servlet.ServletContainerInitializer
- spring autowiring not working from a non-spring managed class
- How to parse gzip encoded response with RestTemplate in Spring-Web
- How to mock Spring WebFlux WebClient?
- Spring Security 3.2 CSRF disable for specific URLs
- Configure Multiple MongoDB repositories with Spring Data Mongo
- With Spring Security 3.2.0.RELEASE, how can I get the CSRF token in a page that is purely HTML with no tag libs
- How to allow a User only access their own data in Spring Boot / Spring Security?
- Spring – How to stream large multipart file uploads to database without storing on local file system [duplicate]
- Understanding contexts in Spring MVC
- Trying to create REST-ful URLs with multiple dots in the “filename” part – Spring 3.0 MVC
- With Spring Data REST, why is the @Version property becoming an ETag and not included in the representation?