thymeleaf-spring
thymeleaf-spring copied to clipboard
Add support full class name for #mvc.url
Example I have 2 controllers with names AccountController and AuthorController
- for first one mapping will be ${#mvc.url('AC#getAll').build()}
- for second one mapping will be ${#mvc.url('AC#getAll').build()}
they are same and will get java.lang.IllegalArgumentException: No unique match for mapping AC#getAll:
And where is no possibility to use some qualifier or full controller name.
Example I can use for mappings like
${#mvc.url('AccountController#getAll').build()}
but now I'm getting java.lang.IllegalArgumentException: Mapping not found: AccountController#getAll
Please add support to use full controller name
If somebody think this is useful please vote
Very useful. I got this error a couple minutes ago and realize that I had two methods with the same name and had to change one of them, even one being a get and the other being a post.
It's an issue with Spring MVC and not Thymeleaf.
The name is generated by org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMethodMappingNamingStrategy
. You can override the name it produces by giving your mapping a name specifically.
@Controller
class MyController {
@GetMapping("/", name="MyController") // Generates 'MyController#index'
fun index() = "index"
}