jsp中的代码:
<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<html>
<head></head>
<script type="text/javascript">
function f(num){
document.getElementById("form").action="multiButton?test="+num;
document.getElementById("form").submit();
}
</script>
<body style="font-size:30px">
<form id='form' method="post">
<input type="button" value="1" οnclick="f(1)"/>
<input type="button" value="2" οnclick="f(2)"/>
<input type="button" value="3" οnclick="f(3)"/>
<input type="button" value="4" οnclick="f(4)"/>
</form>
</body>
</html>