There are many similar questions but I am not clear about one thing as mentioned below-
I have ajax call
var url = '/test/testjsp.do?param1=' + xyz;
$.ajax({
type:'GET',
dataType:'html',
url:url,
success:function (data) {
alert("Success");
}
});
which is calling an JSP page and in that file, I am calling method from SM class
<%@ page import="com.testAjax.SM" %>
<%
if (null != request.getParameter("
SM.randomMethod(request.getParameter("param1"));
}
%>
So my question is ,
I there any alternative method where I don't have to create extra Jsp file and call java method directly from Ajax call
Please help and Advise