There is a site, which passes me a parameter token
, only if I call the base url of the site. For example, only when I call http://www.site.com
it converts it to http://www.site.com?token=979797979
. because of this, url-pattern
line in my web.xml
document looks like:
<url-pattern>/</url-pattern>
I have servlet which processes this call, but when I am trying to call a servlet from Jquery's $.ajax
it doesn't work, because the URL has empty string but it needs to have the empty string because the call to the site is to the home URL.
$.ajax({
type: "GET",
url: "",
success: function(data1){ alert(data1) }
}
Maybe I don't understand something. Can anyone help?
Try the URL "/".
jQuery should then perform a GET request on the root URL of your site – in your case "http://www.site.com".