Announcement Announcement Module
Collapse
No announcement yet.
Edit Form problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Edit Form problem

    Hello all,

    I trying to create an edit form with Spring MVC. The idea is that when the user calls the page with an id parameter, e.g. /form.do?id=1, on the formBackingObject of my SimpleFormController I will retrieve the model with id=1.

    Then, on the jsp, the form is shown.

    My problem is that when the user submits the form to update the model, I get a typeMismatch for the id parameter (I'm using Spring's CustomNumberEditor).
    That's because the id parameter reaches the controller as "1,1", because on the jsp form the action is the current url (/form.do?id=1), and the form has a hidden parameter id=1. So, as I have two id parameters, it becomes a "1,1" value, originating the typeMismatch problem.

    How is the best way to fix this problem?
    Should I clean the url on the form action? (the jsp will be shared with other controllers, so I would not like to hardcode the action url).
    Is there any other options to fix this?

    Thanks in advance!
Working...
X