• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot submit unchecked checkbox to Controller.

 
Mike London
Ranch Hand
Posts: 1190
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a simple check box defined in a JSP like this:



In the controller, I have a @ReqestParam defined like this:



Yet, when I submit the form, if the checkbox was unchecked, I get the error: "The request sent by the client was syntactically incorrect ()."

If the checkbox is checked, then it works.

I've tried changing the type to boolean as the type in the Controller, but get the same behavior.

So, how do you handle a checkbox correctly so that you can determine, when submitted to the Controller that it was *not* checked?

(the controller never seems to run if the checkbox was not checked)

Thanks in advance.

--mike
 
Mike London
Ranch Hand
Posts: 1190
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The issue was that I had multiple "@RequestParam" elements in the method definition instead of one with multiple parameters listed.

- mike
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic