I have my Action
class below in which getTspNameIdMap
throws ReqMgmtException
exception (custom exception).
public String findTspNameIdMap(){
SlsReqMgmtCommonRemote slsReqMgmtCommonRemote = null;
tspNameIdMap = new HashMap<String, String>();
try{
slsReqMgmtCommonRemote = getSlsReqMgmtCommonRemote();
tspNameIdMap = slsReqMgmtCommonRemote.getTspNameIdMap(gmaThresholdParameters.getId().getCircleId());
}
catch(ReqMgmtException rEx){
addActionError(rEx.getError());
result = "error";
return ERROR;
}
catch (Exception e){
addActionError("Error in processing your request. Contact Administrator");
e.printStackTrace();
System.out.println("[ConfigureTspThresholdAction: findTspNameIdMap Function]:In catch Inside Constructor!!");
result = "error";
return ERROR;
}
return SUCCESS;
}
I know there is exception handling in Struts2 too, however presently I am not using it.
Should I use Struts2 exception handling? What would be its usage?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…