Hi all ,
I ahve the following requirement. I need to be able to configure an exception and if the particular exception is caught I need the handler to be invoked.
Is this possible in Spring
-Thanks,
Hi all ,
I ahve the following requirement. I need to be able to configure an exception and if the particular exception is caught I need the handler to be invoked.
Is this possible in Spring
-Thanks,
you can create your own set of Exceptions and throw them
and handle in some Action/Controller
something like this
am i right?Code:public List<Proveedor> getAllProveedoresDAO()throws MyGlobalException{ List<Proveedor> mylist = new ArrayList<Proveedor>(); try{ mylist = (List) getHibernateTemplate().find("FROM Proveedor p WHERE p.idProveedor!='100000' "); if(mylist.isEmpty()) throw new MyListEmptyException(); } catch(DataAccessException dae){ logger.info("DataAccessException"+dae.getMessage()); throw new MyGlobalException(); } return mylist; }
regards
- Manuel Jordan
Kill Your Pride, Share Your Knowledge With All
The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7
Blog
Technical Reviewer of Apress
- Pro SpringSource dm Server
- Spring Enterprise Recipes: A Problem-Solution Approach
- Spring Recipes: A Problem-Solution Approach, 2nd Edition
- Pro Spring Integration
- Pro Spring Batch
- Pro Spring 3
- Pro Spring MVC: With Web Flow
- Pro Spring Security
Hi,
if you just want to caught an exception, you can wrap the call with an after-throwing advice.
Have a look here if you want to go for Spring XML-AOP
regards
agim
Thanks for ur reply. Can I achieve the same using Spring IOC instead of AOP?
Last edited by karldmoore; Aug 29th, 2007 at 11:54 AM.
Barracuda Networks SSL VPN Lead Developer
http://pramatr.wordpress.com
http://twitter.com/karldmoore
http://www.linkedin.com/in/karldmoore
Any postings are my own opinion, and should not be attributed to my employer or clients.