• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Struts2Jquery plugin error handling  RSS feed

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

from below link i am calling one action class which will throw runtime exception.





since i am calling it through struts2jquery plugin widget , how to know some thing is happened at server side? right now it is not showing any error.

Rgds
Peter

 
Bartender
Posts: 9559
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Struts swallows unhandled exceptions. The typical way to handle a problem at the Action level is to add an ActionError instance and use the actionerror tag to print the errors out on the JSP page.
You should also print the exception and stack trace out to a log file (along with the other debugging information you are already logging, right???) so you will have an idea as to what happened to create the problem
 
James Peter
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

thanks for reply. if i call action using <sj:a like below one then how can i receive actionerror object?
can we attach any javascript function to this <sj:a so that when we get action error we can read it?



for example if we use <sj:submit then we can specify a javascript function and handle any action errors and formfield errors.

validateFunction="customeValidation"

Rgds
Peter
 
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!