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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:05:01+00:00 2026-06-15T21:05:01+00:00

This is a syntax question about a Spring configuration (refer to spring-beans-3.1.xsd and spring-mvc-3.1.xsd).

  • 0

This is a syntax question about a Spring configuration (refer to spring-beans-3.1.xsd and spring-mvc-3.1.xsd).

I have a specific bean definition (id=”SecurityRequestParametersArgumentResolver”) that I want to register as a custom argument resolver. The xml fragment is:

<bean id="SecurityRequestParametersArgumentResolver"
    class="xxx.security.web.SecurityRequestParametersArgumentResolver">
    <property name="credentialsManager" ref="CredentialsManager" />
    <property name="tokenService" ref="TokenService" />
</bean>

... AND I would like to use a bean reference.  The following three lines don't obey the xsd-grammar ( what should be the correct tag declaration here? )
<mvc:annotation-driven>
    <mvc:argument-resolvers>
        <bean ref="SecurityRequestParametersArgumentResolver"/>
    </mvc:argument-resolvers>
</mvc:annotation-driven>

… All of the examples I have seen look like THIS, and thus are going after the default no-argument constructor

<mvc:annotation-driven>
    <mvc:argument-resolvers>
        <bean class="class="xxx.security.web.SecurityRequestParametersArgumentResolver"/>
    </mvc:argument-resolvers>
</mvc:annotation-driven>

Repeating the question, what should the Spring syntax be in order to use a bean reference as a custom argument resolver?

Thanks!

  • 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-15T21:05:03+00:00Added an answer on June 15, 2026 at 9:05 pm

    At least the constructor argument problem can be solved easily

    <mvc:annotation-driven>
        <mvc:argument-resolvers>
            <bean class="class="xxx.security.web.SecurityRequestParametersArgumentResolver">
               <constructor-arg value="123"/>
            </bean>
        </mvc:argument-resolvers>
    </mvc:annotation-driven>
    

    But I do not know any way to use a reference instead of a bean within <mvc:argument-resolvers>. But depending on what you want to do, there are several workarrounds.

    • Use a Bean Factory
    • Create a proxy class that implements the HandlerMethodArgumentResolver and forward every call to an other instance, then you can have your own SecurityRequestParametersArgumentResolver like a normal bean and register the Proxy in the <mvc:argument-resolvers> section.

    Proxy:

    class HandlerMethodArgumentResolverProxy
           implements HandlerMethodArgumentResolver{
        HandlerMethodArgumentResolver delegate;
    
        publicHandlerMethodArgumentResolverProxy
                       (HandlerMethodArgumentResolver delegate){
            this.delegate=delegate;
        }
    
        public boolean supportsParameter(MethodParameter parameter) {
            this.delegate.supportsParameter(parameter);
        }
    
        //delegate for resolveArgument        
    }
    

    config:

    <bean id="securityRequestParametersArgumentResolver"
        class="xxx.security.web.SecurityRequestParametersArgumentResolver">
        ...
    </bean>
    
    <mvc:annotation-driven>
        <mvc:argument-resolvers>
            <bean class "HandlerMethodArgumentResolverProxy">
                 <constructor-arg 
                     ref="securityRequestParametersArgumentResolver"/>
            </bean>
        </mvc:argument-resolvers>
    </mvc:annotation-driven>  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to set GridView.DataKeyNames (This is really a question about the syntax for
This is a question about style and design rather than syntax. I have domain
EDIT: This question is about finding definitive reference to MySQL syntax on SELECT modifying
This is related to this question I asked earlier about syntax highlighting user-defined blocks
Basic C# syntax question: So I have this class public class BrandQuery<T> : Query<T>
I've seen this syntax show up, and have tried to google for it's definition
I have a question about java syntax. I've found sample program. public class Main
I have a question about the syntax of the Java main declaration: public static
A coworker's typo when calling a subref raised this strange syntax question. If I
This is hopefully a softball syntax question: I need to call a method with

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.