I am using ajax with servlets. So for every different ajax call, i am calling a different servlet, getting the data through a simple Dao class and sending back as the response to html , something like this
So, can i directly call my simple java class (Dao) from html for ajax calls, (instead of calling it indirectly through servlet)? If yes, how can i send it back as a response (from simple java class) to ajax code(html)?
Even with ajax , the entire thing boils down to HttpServletRequest and HttpServletResponse.
There is no obvious way to do what you are asking for; afterall both the request and response objects will be handled by the container only.
Joined: Jun 05, 2010
Thanks for your reply Saikat Mukherjee.
That means, that if my form has various textfields with different ajax calls, then, i will have to go for that many servlets?