Verwendung von Struts2-Ausnahmebehandlung?
Ich habe meineAction
Klasse darunter, in dergetTspNameIdMap
wirftReqMgmtException
Ausnahme (benutzerdefinierte Ausnahme).
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;
}
Ich weiß, dass es in Struts2 auch eine Ausnahmebehandlung gibt, aber ich verwende sie derzeit nicht. Sollte ich die Ausnahmebehandlung von Struts2 verwenden? Was wäre seine Verwendung?