Skip to content

hbrands/demo-multidispatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

demo-multidispatch

Demo project to show Spring Boot working with multiple dispatcher servlets. Currently, not all @SpringBootTest tests run.

Structure

Basically, it's a standard Spring Boot Application with Autoconfiguration and Web, Security starters. There is a DefaultController as RestController registered with the default dispatcher servlet. See package com.example.demo.

What's special is, that in the WebConfig configuration class an additional DispatcherServlet is registered. This dispatcher servlet has its own application context RestServletConfig. This config finds per ComponentScan additional RestControllers like the WebController. This RestServletConfig could also include additional bean defs, but that's not important here. See package com.example.web.

This application seems to run fine.

The @SpringBootTest tests for the DefaultController also run fine.

What's not working is a test for the WebController (WebControllerTests#helloAuthorized()). When the test user is authenticated/authorized, I get a 404 error instead of the expected 200 status.

open questions

  • Am I doing something wrong or am I missing something?

  • Is @SpringBootTest supposed to work with multiple dispatcher servlets? If yes, how?

  • are there example projects or documentation pointers regarding multiple dispatcher servlets?

About

Spring Boot with multiple dispatcher servlets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages