-2

I have written jsp code as,

<form:form method="post" action="/getnextinvoice">
    <table>
    <tr>
        <td>&nbsp;</td>
        <td><input type="submit" onclick="getnextinvoice()" value="New" /></td>
        <td>&nbsp;</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.

Mahi Mali
  • 33
  • 1
  • 2
  • 8

1 Answers1

0

Take a look at this tutorial here at how views are mapped against actions calls.

Link

Saif Asif
  • 5,516
  • 3
  • 31
  • 48