简体   繁体   中英

AJAX 404 Not Found error

I am facing some problem while working on JBOSS 4.0.2 .

What I am trying to do is to make a simple AJAX call from a jsp file to a servlet class file which is stored in the WEB-INF/classes/servlet here .

The hierarchy is like this:

server/ABC/deploy/xyz.war/customform/form/a.jsp
server/ABC/deploy/xyz.war/WEB-INF/classes/abc.class

added this manually in web.xml

<servlet><servlet-name>abc</servlet-name><servlet-class>abc</servlet-class></servlet>

....

<servlet-mapping><servlet-name>abc</servlet-name><url-pattern>/abc</url-pattern></servlet-mapping>

URL in AJAX is same as given in the <url-pattern>

I get AJAX status "404" when send requset to the servlet.

Also, when I used alert box to show the status, it replied "Unspecified error" and after that status=404 for readyState=2 , readyState=3 , readyState=4

I can't figure it out that why it is not able to call the servlet.

Are there other steps required to be done for calling that servlet that I am missing,

or

If I went somewhere wrong, please point out the mistake.

It would be a great help if someone posts the steps to be done for such a calling to the servlet.

好吧,看来您是以下之一:编程错误,太糟糕了,它不显示行号,或者您的服务器软件需要更新。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM