I am new to spring web applications. When I submit a form, the request mapping is getting a "dual" parameter. My form is set as:

<form action="" method="post" name="myform">
......
</form>

I use a javascript to submit the form, for example, when I submit the form for going to various pages, my javascript is like this:

function gotoPage(pageNumber)
{
 document.forms['myform'].action="trx?page=" + pageNumber;
 document.forms['myform'].submit();
}

So when I have a link like this on my jsp page,

<a href="javascript:gotoPage('3')">Page number: 3</a>

On my controller for the request mapping for /trx, I should be getting parameter page as value "3", but I am getting value as "3,3".

Any ideas why? I noticed only on the page parameter, If I use parameters like action=search or action=sort. It all works out fine.

有帮助吗?

解决方案

Dumb question. :)
Had a <select name="page"> in the form.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top