• 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:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Checked exceptions in struts

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends
i am new to struts and i have a small doubt
how can we handle the checked exceptions( ex:-- NumberFormat Exception) in struts
please help me
vinay
 
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi kumar

U can handle this exception also .but its not a good practice to do a that....
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by sreenath reddy:
Hi kumar

U can handle this exception also .but its not a good practice to do a that....



I completely disagree about this being a bad practice in general. You should catch and handle any Exception for which you want to display a specific and meaningful error message to the user.
 
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am with marc. handling exceptions is a MUST!

struts has built-in mechanisms (via struts-config.xml mappings) to map exceptions globally or locally (to each action) and forward to a JSP, action, or tiles definition when an exception is thrown. you can also define exception handler for each exception (see http://struts.apache.org/userGuide/building_controller.html#exception_handler ... use the 'path' attribute instead of 'handler' attribute if you want to forward to JSP/action/tiles def).
reply
    Bookmark Topic Watch Topic
  • New Topic