background preloader

Issues Multi @Controller same URL - Spring MVC

Facebook Twitter

Spring security - BeanFactory not initialized or already closed - call 'refresh' before accessing beans. Mapping many/all URL’s to a single spring controller using annotations. Once in a while this kind of a question pops up on the spring forums.

Mapping many/all URL’s to a single spring controller using annotations

The requirement is almost always the same : Map many URLs to a single controller and/or map all URL’s without a defacto mapping to a default controller. Both have different solutions. Let’s discuss the first one. The @RequestMapping annotation makes configuring spring controllers a breeze. The value param of the annotation accepts a string array of url’s, most of us miss this part. Spring REST multiple controllers for one URL but different http methods. Java - Request method problem in Spring MVC.