Search code examples
springexceptionservice-layer

what is best way service layer can provide to tell Controller part if anything happens bad(Exception)


I am using spring3.0.2 for my project "Online Exam"

Putting business logic in service layer makes controller easy to feel.

what is best way service layer can provide to tell Controller part if anything happens bad(Exception)

Eager to hear soon!!


Solution

  • Throw your own exceptions, and then, catch them inside your controller so you can define exactly the best behavior