URL problem in ajax

hi

I m using ajax to retrieve data from a database. I know the syntax for the .open() function is

httpreq.open("GET",url,true);//httpreq is my variable

now in the data retrieving part, it goes into a status 404 that means file has not been found.

var url="/opt/sun/domains/domain1/docroot/get_details.jsp";

This is how i specified my URL. I m on a linux machine. I provided the ful path of the Jsp file. And i run the html file by putting

http://localhost:8080/employee_details.html

so it is connecting to the java application server. So y is it entering the 404 status. Do i have to specify something else in the var url?..

sorry for these newbie questions, but I thot this is the best place to ask fr problems.

if(httpreq.readyState==4)//state 4 means server is ready for requests.

{

alert("Connected to server and its ready for requests");

if(httpreq.status==200)//everything is OK

{

var response = httpreq.responseText;

alert("repsonse looks like this : " + response);

document.getElementById('myDiv').innerHTML=response;

}

elseif(httpreq.status == 404)

{

alert("SORRY URL DOES NOT EXIST!");

}

[1808 byte] By [ubarua123a] at [2007-11-27 10:29:08]
# 1

Is the URL http://localhost:8080/employee_details.html actually valid? Aren't you missing the contextroot name (generally the project name)?

BalusCa at 2007-7-28 17:55:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

I dont think project name shud be an issue coz i wrote this in an editor and i stored it in the folder where the jsp files are executed i,e the docroot. unless u meant something else.. help me out plz :)

ubarua123a at 2007-7-28 17:55:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Well .. Open this URL in your browser and check if you see the actual contents or if you get an 404.

BalusCa at 2007-7-28 17:55:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

i get the actual contents, no 404. I said it b4 only. Only in the program its not able to find the file. Really dont get it.

Got hold of it thanx.. Finally displaying.. I just had to provide the file name, no path nothing..

ubarua123a at 2007-7-28 17:55:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...