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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:37:46+00:00 2026-05-26T08:37:46+00:00

Yesterday I downloaded the new Spring 3.1RC to test the just introduced support for

  • 0

Yesterday I downloaded the new Spring 3.1RC to test the just introduced support for flash scoped variables in Spring MVC. Unfortunately I could not make it working…

I have a HTML form containing some checkboxes without spring:forms tags. Something like this:

<form action="/deleteaction" method="post">
<input type="checkbox" name="itemId" value="1" />
<input type="checkbox" name="itemId" value="2" />
<input type="submit" name="delete" value="Delete items" />
</form>

Before the Flash scope support, my annotated controller looked like:

@RequestMapping(value = "/deleteaction", method = RequestMethod.POST, params={"delete"})
public String deleteItems(@RequestParam(value="itemId", required=false) String itemId[]) {

Alternatively, I could have used an HttpServletRequest instead of @RequestParam:

@RequestMapping(value = "/deleteaction", method = RequestMethod.POST, params={"delete"})
public String deleteItems(HttpServletRequest request) {
    String itemIds[] = request.getParameterValues("itemId");

Both methods were working fine. If I try to add the RedirectAttributes to the method parameters, Spring will throw an exception:

@RequestMapping(value = "/deleteaction", method = RequestMethod.POST, params={"delete"})
public String deleteItems(@RequestParam(value="itemId", required=false) String itemId[], RedirectAttributes redirectAttrs) {

Log:

Oct 16, 2011 11:20:37 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/App] threw
    exception [Request processing failed; nested exception is
    java.lang.IllegalArgumentException: argument type mismatch] with root cause 
    java.lang.IllegalArgumentException: argument type mismatch

What am I doing wrong? How is it possible to get the RedirectAttribues parameter where to add flash scoped variables?

  • 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-26T08:37:47+00:00Added an answer on May 26, 2026 at 8:37 am

    In order to use the new RedirectAttributes, the old DefaultAnnotationHandlerMapping, AnnotationMethodHandlerAdapter and AnnotationMethodHandlerExceptionResolver must be replaced in the dispatcher-servlet.xml.

    One chance is to use <mvc:annotation-driven/>, which in Spring 3.1 configures new classes RequestMappingHandlerMapping, RequestMappingHandlerAdapter, and ExceptionHandlerExceptionResolver replacing the old ones.

    Otherwise, the new handler classes must be explicitly configured in dispatcher-servlet.xml.

    Some extra info here: http://forum.springsource.org/showthread.php?115976-Spring-MVC-FlashMap-and-RedirectAttributes-request-mapping

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

Sidebar

Related Questions

Disclaimer: I'm new to most of this I just downloaded virtualbox yesterday and installed
Yesterday I made myself a new my first App ID, all Certificates and downloaded
I just started reading "Pro Spring MVC with web flow" and it comes with
I have started using Ninject 2 (downloaded from Github yesterday including the MVC extension
Just Downloaded the WP7 SDK yestarday - And I'm new to Silver light -
Yesterday, I could deploy my services perfectly fine to the hosted service instance on
My mysql installation is new and it was working a yesterday. Now, any MySQL
Adobe released projector, debugger and plugin for Flash 10.1 yesterday. on my Mac i've
I downloaded the Windows Phone 7 SDK yesterday but when I installed it on
I downloaded a program yesterday, it is for encryption and security. I won't name

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.