I am novice in the UI, we are trying to implement a web call using a JQuery where we are have observer a strange issue of webcall i.e, when we are trying to do a post http call we have observer in server access logs first http post call is made and then immediately one http get call exist.
Please find below the .jsp page:
<html>
<head>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<%
String urlVal = (String) request.getAttribute("dataURL");
%>
<%
String emailID = (String) request.getAttribute("emailID") ;
%>
<script type="text/javascript">
var url="<%=urlVal%>";
alert(url);
function navigateWithForm() {
var form = $('<form></form>');
form.attr({
method: 'POST',
action: url
});
form.append(getInput());
form.appendTo('body').submit();
}
function getInput() {
alert("<%=emailID%>");
return $('<input type="hidden" />').attr({
name: 'header',
value: '<%=emailID%>'
});
}
$(document).ready(function() {
navigateWithForm();
});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
</html>
In the backend the service are deployed in weblogic and it is designed in the spring 2.5 framework. We have apache proxy server for load balancing.
Any help will be appreciated.
Finally after many days struggle, i have found out the solution of the issue. which is really a small change. Hope the solution will be useful for the someone else who are struggling with the issue. Actual issue is with the url/action of the Jquery call.
URL passed earlier
Context:root?param1=value¶m2=2
Correct URL passed is
Context:root/?param1=value¶m2=2.
Thanks to Phil where i have to see the header of the request and response and other such as location, origin and referrer