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,
Printable View
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
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?