My main controller serves the public user. It has the following mappings:
@Controller
@RequestMapping(value="/")
public class HomeController extends BaseController {
@RequestMapping("/") // handles www.somesite.com
public ModelAndView request(Model model) {
@RequestMapping("/{contentId}") // handles www.somesite.com/sports
public ModelAndView requestWithContentId(@PathVariable String contentId, Model model) {
@RequestMapping("/{contentId}/**") // handles www.somesite.com/sports/hockey/nhl , etc
public ModelAndView requestWithContentId2(@PathVariable String contentId, Model model) {
I also have a set of admin controllers that map to paths matching /admin*. Here's one example:
@Controller
@RequestMapping(value="/admin/article")
public class AdminArticleController extends BaseController
I find that my main controller mappings are of higher priority. Consequently, request for /admin/article is processed by the main controller and not by dedicated AdminArticleController. How can I fix this?
I also notice that requests for style sheet sitting in /static/default.css, also go through the main controller. Is there a way to avoid this?