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

The Archive Base Latest Questions

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

I have an action method on a Spring MVC controller that has an argument

  • 0

I have an action method on a Spring MVC controller that has an argument annotated with @ModelAttribute. However, I don’t know at compile time what the type of this parameter will be – I know the abstract base type but not the derived type.

At runtime, I will be able to decide what class I am expecting and I will be able to get a new’d up instance of this class. However, I have no idea what code I should be calling to parse the request data in the same fashion that @ModelAttribute does.

I’ve looked around and it seems that if i can get a hold of a WebRequestDataBinder I can use that to populate my object, but for that I need a BinderFactory and this is where I kind of get lost.

Can anyone give me some pointers here – or tell me that I am looking at it the wrong way and need to do something else?

  • 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-15T14:37:03+00:00Added an answer on June 15, 2026 at 2:37 pm

    you can inject the model itself in your controllers method and access the attribute yourself.

    @RequestMapping(...)
    public void doStuff(ModelMap model) {
        Object attr = model.get("nameOfAttribute");
        // ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MVC application which has a Controller that has a recursive method
I have a Spring MVC controller with an action that's called using AJAX. @SessionAttributes({userContext})
I currently have a Spring MVC controller that takes a MultipartFile @RequestMapping(method = RequestMethod.POST)
I have an action method that depending on some conditions needs to return a
I have an action method that takes in two different objects. I am posting
I have an action method VerifyNewUser() that gets called when the user clicks a
I have the following code in my controller action method: if (User.Identity.IsAuthenticated) { //
I currently have an ASP .NET MVC site that has two domains pointing to
Lets say I have a Spring MVC form like this: <form:form action=${pageContext.servletContext.contextPath}/secure/main.htm commandName=secure/main> <form:input
Do we have something like @url.action and @url.content in Spring MVC like ASP.net MVC?

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.