Java: How would I write a try-catch-repeat block?

后端 未结 4 2038
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-14 20:00

I am aware of a counter approach to do this. I was wondering if there is a nice and compact way to do this.

4条回答
  •  执念已碎
    2020-12-14 20:46

    if you are using Spring already, you might want to create an aspect for this behavior as it is a cross-cutting concern and all you need to create is a pointcut that matches all your methods that need the functionality. see http://static.springsource.org/spring/docs/2.5.x/reference/aop.html#aop-ataspectj-example

提交回复
热议问题