Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Corrupting Data on submit - "5" turns into "5,5", turns into "5,5,5,5", etc... [SPR-10697] #15325

Closed
spring-projects-issues opened this issue Jun 26, 2013 · 2 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: invalid An issue that we don't feel is valid

Comments

@spring-projects-issues
Copy link
Collaborator

Will Dev opened SPR-10697 and commented

See attached file "Screenshots.png" for a straightforward description of what's happening.

Spring MVC is majorly corrupting submitted data. We start with a text field with "10" in it, we submit it and re-display the exact same data that we just submitted, and it's been turned into "10,10". Resumbit it again, we get "10,10,10,10"...etc etc.

I created a fairly straightforward test case to reproduce this problem (see attached files).


Affects: 3.1.1

Attachments:

Referenced from: commits spring-attic/spring-framework-issues@e3588bf

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues
Copy link
Collaborator Author

Phil Webb commented

You are writing the following line multiple times with each page (because it is in your nested for loop):

<form:hidden path="software[${softwareVOStatus.index}].name"/>

If you trace the initial HTTP POST you will see that software[0].name=5 appears twice. Spring converts these 2 values to "5,5".

You need to remove the duplicated hidden form fields, perhaps move it outside of the nested for loop.

@spring-projects-issues spring-projects-issues added type: bug A general bug status: invalid An issue that we don't feel is valid in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues removed the type: bug A general bug label Jan 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

2 participants