I have written jsp code as,
<form:form method="post" action="/getnextinvoice">
<table>
<tr>
<td> </td>
<td><input type="submit" onclick="getnextinvoice()" value="New" /></td>
<td> </td>
<td><input type="submit" value="Submit" /></td>
</tr>
</table>
</form:form>
Here form "action" get calls well from java page function. But i want to call "onclick" property to call the java function. My java function is as,
@RequestMapping("/getnextinvoice")
public String getnextinvoice(@ModelAttribute usercreation user) {
String invoice = iDaoImpl.getInvoiceNo();
System.out.println(invoice);
return "redirect:/Invoice";
}
So Please help me ,and thanks in advance.