This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
No announcement yet.
Is there a way to prevent querystring parameter binding toPage Title Module
I don't think overriding isFormSubmission will help me. Because my POST request IS a form submission and I still want to bind the form values to my command but not the query string parameters. The functionality I am looking for is
if(request == GET)
bind querystring parameters to my command
if(request == POST)
bind ONLY post parametes to my commnd
Unless I am missing something. As far as I know overriding isFormSubmission is not going to work.
1) isFormSubmission does not take a (Object command) argument so I cannot do the binding myself in isFormSubmission as it was suggested.
2) Overriding it to return a false when I recieve a POST request will cause BOTH post and querystring parameters not to be binded to the command object. I do want the post parameters to be binded to the command object just NOT the querystring parameters.
I was able to get around this problem by specifying an "action" attribute for my form that does not include the querystring parameters <form action="/path/file.html">. So now the request object resulting from the POST does not include the querystring parameters.
I had not included an action attribute before because I was using tiles. So the requestUrl defaulted to the current URL which included the querystring parameters.