• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Exception Handling while making Ajax calls

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am developing an application using JSF2, Primefaces and Hibernate. I have lot of Ajax calls. Can any one advice me how to handle the situation when there is any run time exception like null pointer exceptions, array index out of bound exceptions...?

And also I have a problem to make generic exception handling. Can any body give example for this?

Thanks for your help in advance.
 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably have to trap these exceptions in your servlet's and send a response back that tells the ajax call it's an exception. I imagine you could be as generic or a specific as you'd like with your exception-response.

Otherwise, ajax calls don't have a way to differentiate between successful responses and erroneous responses.

IMO jQuery has a good ajax api. Works well for this scenario.
 
jaisai vijay
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Philip,

Thanks for your response. What is that IMO jQuery? I googled for it I couldn't find any information about IMO jQuery.

Thanks,
 
Philip Thamaravelil
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no problem. I was saying in my opinion (IMO) jQuery is a good javascript library.

It abstracts all the javascript required to make ajax calls..No messing with the xmlhttp object..just pure jquery..

http://jquery.org/ is the website, they have lot's of examples.


Also, I've had great experience with jQuery mobile for your mobile applications.



 
jaisai vijay
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am sorry I thought IMO means that is a library.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic