The moose likes Servlets and the fly likes problem in servlet with Ajax Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "problem in servlet with Ajax" Watch "problem in servlet with Ajax" New topic

problem in servlet with Ajax

Ritesh raushan
Ranch Hand

Joined: Aug 29, 2012
Posts: 100
when i submit request output has not come and also not give errors.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63874

Please post your code again with proper indentation. Unindented code is just too hard to read. But on an initial inspection, it does not look like you are using Ajax correctly.

[Asking smart questions] [About Bear] [Books by Bear]
Ayan mallick
Ranch Hand

Joined: Nov 17, 2012
Posts: 46
you can check with javascript alert whether functions are being called properly.

then you can put print statement in the servlet to check whether request is coming upto servlet or not.

go step by step and check where is the problem.

I think type of http request would be "GET" not "get".
Petro Gordiievych

Joined: Dec 29, 2012
Posts: 2
Try instead use Since as form will be submit after you click on button, because type is "submit" and don't go though fun1(). If it doesn't work may I suggest you to use jQuery instead pour JS Ajax, it can save lot of time and be crossbrowser solution. For example to your case:

Don't forgot add two JS library:
I agree. Here's the link:
subject: problem in servlet with Ajax
It's not a secret anymore!