jquery - call a jsp method from javascript -


I use a method like this in the jsp page and the page is saved in the name of new.jsp <> pre &%! Public zero createXml (string graph) throws exception {try {string str = "dinesh" DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance (); DocumentBuilder docBuilder = builderFactory.newDocumentBuilder (); Document doctor = docbuilder.newDocument (); } Hold (exception e) {System.out.println (e); }}% ​​& Gt;

If I call this page like this

    

However, I just want to call this method to create createXml using javascript or jquery coding because I am adding different methods in new.jsp. Any person can call the method without having to call the entire jsp page

You are able to make an AJAX request easily with it or with jQuery:

  $. Post ('new.jsp', {param1: 'param1value', param2: 'param2value'}, function (data) {if (data) {console.log (data); // response to your server}}); There is too much information in   



Comments