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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:35:54+00:00 2026-05-15T23:35:54+00:00

Is ModelMap just the new name in Spring 3 for a ModelAndView ? Does

  • 0

Is ModelMap just the new name in Spring 3 for a ModelAndView?

Does the functionality change in Spring 3?

Consider this code in a Spring 3 app using a ModelMap:

 @RequestMapping(value = "/order", method = RequestMethod.GET)
 public final String setup(final ModelMap model)
 {
  model.addAttribute(ORDER, new Order());
  return "setup";
 }

I would like to know what the equivalent use here of ModelAndView would be in an older Spring app? Would it just require a name change from ModelMap to ModelAndView to get this working in Spring 2.5?

  • 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-05-15T23:35:54+00:00Added an answer on May 15, 2026 at 11:35 pm

    ModelAndView, as its name suggests, contains the model, and the name of the view. ModelMap, in contract, only contains information about the model.

    Your example would have been written (in “old” Spring) as

     public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
     {
      return new ModelAndView("setup", ORDER, new Order());
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My Spring MVC app is full of methods that look like this: @RequestMapping(value =
I'm planning to use spring ModelMap. And also like to specify the view name
What are the benifits of using ModelMap instead of a simple Map in Spring
In my Spring app, I have the following: @RequestMapping(method = RequestMethod.GET, value = /)
This is the controller class @Controller public class ReportController { @RequestMapping(/reports.htm) public void onSubmit(ModelMap
An item is displayed at this URL: /item/10101 using this Controller method: @RequestMapping(value =
I have written the following code : @Controller @RequestMapping(/test) public class Home { @RequestMapping(value
Is it possible to dynamically set a Spring MVC portlet:actionURL portlet:param using javascript? I
I am using Jackson and a ContentNegotiatingViewResolver to return JSON from Spring controllers. When
I'm using spring MVC and spring security. I have annotation-driven controller and trying to

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.