0

I am sending some data from AJAX to a servlet. This syntax works very well on my local.

xmlhttp.open("GET", "../MyTestServlet?section="+sId, true);

However, on our DEV UNIX server this does not work. I tried the following, but this does not work

xmlhttp.open("GET", "<%=request.getContextPath()%>/MyTestServlet?section=+sId", true);

The servlets are in the following package "com.myPackage.myApp.servlets"

What would be the right syntax?

4

2 回答 2

0

尝试在服务器系统上使用真实路径

ServletContext.getRealPath()

于 2012-09-25T17:21:18.037 回答
0

好吧,问题不在于 servlet 的路径,而在于不同的路径。实际上 Query.properties 文件也有路径问题,一旦我解决了它,它就开始工作了。所以实际上第一个链接有效。抱歉,大家在这件事上浪费了你的时间。感谢所有的回复。

于 2012-09-26T22:41:25.870 回答