I have my Action
class below in which getTspNameIdMap
throws ReqMgmtException
exception (custom exception).
public Str
You should use exception handling mechanism in Struts2, that's what exception
interceptor provides. Also you should handle exceptions in the action method like in your question. If it handles all exceptions good, if not the exception handler could handle it. Also in some methods which doesn't have throws Exception
signature you can only catch the exception but cannot return ERROR
result. So, rethrowing the exception and handling it by the interceptor is the workaround.
References: