I use a method in jsp page like this and the page is saved in the name of new.jsp
<%!
public void createXml(String graph) throws Exception
{
try
{
String str="dinesh"
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = builderFactory.newDocumentBuilder();
Document doc = docBuilder.newDocument();
}
catch(Exception e)
{
System.out.println(e);
}
}
%>
If i call this page like this
<form method="post" action="new.jsp">
But, I want to call this method of createXml only using javascript or jquery coding because i am going add various method in the new.jsp. Any one help this to call method without calling the whole jsp page
What you’re looking for is how to create an ajax request. You can do it without jquery or easily with jQuery:
There’s a lot more info in the jQuery docs