Following is my servlet mapping:
Path: EAR/WAR/WEB-INF/web.xml
<servlet>
<servlet-name>GetChartDetails</servlet-name>
<servlet-class>com.high.GetChartDetails</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>GetChartDetails</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Following in the location of my JSP:
Path: war/Monitor/XYZ.jsp
Inside this jsp, I am trying to make ajax call by calling above servlet as follows:
$.ajax({ type: "GET", url:"http://localhost:25014/Monitor/GetChartDetails? jsonp="+chartType, dataType: 'jsonp', jsonpCallback: chartType, error: function () { alert("Error is occured"); } });
chartType is a string. I am getting the alert as "Error is occured" and servlet is not being called.
Can someone please help me with this. Thank you.
Issue got resolved by changing the servlet mapping.