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 8229239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:44:02+00:00 2026-06-07T16:44:02+00:00

I have a controller uri hierarchy similar to the example below. @RequestMapping(value=company/{id}) public abstract

  • 0

I have a controller uri hierarchy similar to the example below.

@RequestMapping(value="company/{id}")
public abstract class BaseCompanyController 
{
  // variety of helper methods, protected autowired objects 
}

@Controller
@RequestMapping(value = "company/{id}/documents")
public class DocumentsController extends BaseCompanyController
{
  // document controller methods 
   @RequestMapping(value="something",.... etc)
   public void doSomething(){}
}

@Controller
@RequestMapping(value = "company/{id}/financials")
public class FinancialsController extends BaseCompanyController
{
  // financials controllers methods 
}

What I want to do is to define some code to execute before any handler method in any child controllers. For example I would like to run some code before the doSomething method is called on the DocumentsController. The things I want to do are unique for a specific URI hierarchy.

If I use an interceptor to execute before the handler methods how do I extract the URI parameters from the URI such as the company id from /company/{id}? I really don’t want to pares the URL’s by hand?

Can an interceptor be narrowed down with a URI such as /company/{id} do interceptor mappings understand URI templates?

  • 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-07T16:44:03+00:00Added an answer on June 7, 2026 at 4:44 pm

    You can use interceptors only for certain URIs using <mvc:mapping/> and path attribute for each one:

    <mvc:interceptors>
        <mvc:interceptor>
            <mvc:mapping path="/company/*/documents" />
            <bean class="com.mypackage.DocumentsInterceptor" />
        </mvc:interceptor>
    </mvc:interceptors>
    

    Reference here.

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

Sidebar

Related Questions

I have @Controller @RequestMapping(value=core/*) public class CoreController { public static String exceptionOccurredView = /core/exceptionOccurred;
Have Controller: public class MyController : Controller { [HttpGet] public ActionResult MyAction(int iMode, string
i have the codes below class ReservationController extends Zend_Controller_Action { public function init() {
I have an action taking two GUIDs: public class MyActionController : Controller { //...
I have controller and model. i am modifying a variable value in a model,
I have Controller: [MySite]\Controllers\DistributionTools\TrackingChannelsController.cs [HttpPost] public void InitTcFirstPageView() { var model = new TcFirstPageModel
I have an application controller with navigation workflow like so: namespace Ordering.UI.Workflow { public
Lets say I have the following Request URI: /controller/action/filter// When I call $this->_getParam('filter') in
I have a controller in codeigniter called 'Main' with this function: public function index
I have Admin controller in codeigniter class Admin extends CI_Controller { function __construct() {

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.