Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7894737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:28:18+00:00 2026-06-03T07:28:18+00:00

My main controller serves the public user. It has the following mappings: @Controller @RequestMapping(value=/)

  • 0

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
  1. 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?

  2. 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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T07:28:19+00:00Added an answer on June 3, 2026 at 7:28 am

    Change your URL scheme. Starting your URLs with a variable in Spring MVC is pretty bad, for the reason you have just demonstrated.

    Either change your content-links to something like /content/{contentId} or create explicit mappings for all content, i.e. /sports, /whatever…

    As a last resort, if you absolutely can’t change how your URL scheme looks to your users, use something like Tuckey urlrewrite and do a re-write:

    /xyz -> /content/xyz
    

    EXCEPT for “known” context like “admin” or “static”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok heres the situation. I have a View controller class that serves as the
map.root :controller => main, :action => index is not redirecting the main controller to
I have created a MY_Controller and I'm linking to it through my main controller...
So I have a UIViewController (main application controller is a TabBarController). On this there
I've created a new Pylons application and added a controller (main.py) with a template
I have a Reports controller and various reports: http://localhost/reports/main/this_month http://localhost/reports/main/last_month http://localhost/reports/main/this_year I wanted http://localhost
Just need get some vals located in application.ini(main ini) in the Controller plugin I
I've got a lot controller in my Codeigniter apps, ex: Signup, Profile, Main, etc..
Can I capture the following two routes in a single line? GET /game controllers.Main.app.gamelist
I came across the following issue: I have a main simple page on which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.