开发者

What do we need to implement an ajax request servlet-side?

开发者 https://www.devze.com 2023-01-02 19:56 出处:网络
I\'m using jquery, and I want to access some data on my server using ajax. The server is running google app engine (which is just a bunch of servlets). Can someone point me to a sort of tutorial on ho

I'm using jquery, and I want to access some data on my server using ajax. The server is running google app engine (which is just a bunch of servlets). Can someone point me to a sort of tutorial on how to implement a servlet that can talk to an ajax request (ideally made from jquery)?

I think I just need to create a servlet, and the jquery script uses the url for the servlet, nothing else, but I am开发者_如何学Python quite new and ignorant.

Thanks


It is exactly the same as any other servlet.

You get an HTTP request and you make an HTTP response.

The only difference is that you might want to output XML or JSON instead of HTML (in which case, set your Content-Type and find an XML or JSON library that you like).

0

精彩评论

暂无评论...
验证码 换一张
取 消