Hi All, I want to know how can I use Ajax in JSF. For my application for the time being I created a servlet for handling the request and sending the response.But for that I am using HttpServletRequest and Response objects which I don't think is a good practice. Can Anyone tell me how to replace the servlet and use any managed bean to handling the request and response. It will very helpfull to me if you can provide any code snippet.
With RichFaces, most of the magic is in the JSF tags, so little, if any AJAX-specific code has to be provided in the JSF backing beans and there's no need for custom servlets.
AJAX ultimately does do everything in terms of Http Request and Response objects even for non-Java AJAX apps. That's the only way you can communicate with an HTTP server, so you're not doing anything "wrong". However, why code and debug a lot of complicated stuff if someone's already done the really ugly stuff for you?
Sometimes the only way things ever got fixed is because people became uncomfortable.
I have to use Ajax in 2-3 pages in my application and i do not want to use Richfaces. Right Now I have created a Servlet and calling that servlet and getting respons. But I don't think it is good way to do . Please tell me how can i handle ajax request in JSF . Can I do the same from any managed bean. If possible ,How?
You should seriously consider using RichFaces. They do an excellent job of it, and there is no real reason to re-invent the wheel. You will end up spending a ton of time and the result will be inferior to richFaces/ajax4jsf anyways...they have been working on this project for years.
permaculture is largely about replacing oil with people. And one tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss