I have the URL through which my jsp hit the web service which in return gives me the JSON Object. This web service use the BASIC Authentication. I want to send username & password also at the time hitting that service, so it wil not prompt to enter username and password. Can you please provide me the simplest way to achieve this.
I have very less understanding about web services. Going through few silly codes of java script to get the json object which are not working yet.
I have 2 things : 1) URL of Web service (provided by third party) 2) Username &r password for authentication.
When manually in put the web service url in browser it print the json object on browser. But Not getting how to do the same thing through jsp.
Here's some good advice: don't use XMLHttpRequest directly, use a library like jQuery instead, like surlac showed you. You'll save much time in the process, and have a more stable and more maintainable solution in the end.