Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring http/web forward not working with spring-reactive

I am trying to forward a request from one controller to another, but instead I am getting an exception

java.lang.IllegalStateException: Could not resolve view with name 'forward:/test2'. at org.springframework.web.reactive.result.view.ViewResolutionResultHandler.lambda$resolveViews$5(ViewResolutionResultHandler.java:272) ~[spring-web-reactive-5.0.0.BUILD-SNAPSHOT.jar:5.0.0.BUILD-SNAPSHOT]

Here are my controllers :

@Controller
class TestController {
    @RequestMapping(value="/test")
    public String showTestPage() {
        return "forward:/test2";
    }
}

@RestController
public class TestController2 {
    @RequestMapping(value="/test2")
    public String showTestPage() {
        return "testPageView";
    }
}

I am using spring-boot

springBootVersion = '2.0.0.BUILD-SNAPSHOT'

compile('org.springframework.boot.experimental:spring-boot-starter-web-reactive')
@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }
}
like image 374
Dexter Avatar asked Oct 30 '25 02:10

Dexter


1 Answers

This is not supported at the moment.

Please create a new issue on https://jira.spring.io (project: Spring Framework, component: reactive). Some concepts don't really map into the reactive world, so I'm not 100% sure this should be implemented.

like image 114
Brian Clozel Avatar answered Nov 01 '25 17:11

Brian Clozel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!