use of jp.ossc.nimbus.beans.NoSuchPropertyException in project nimbus by nimbus-org.
the class DefaultExceptionHandlerService method handleException.
public void handleException(Throwable th, ServletRequest request, ServletResponse response) throws Throwable {
if (logMessageCode != null) {
final Logger log = super.getLogger();
if (isOutputStackTraceLog) {
log.write(logMessageCode, logMessageArguments, th);
} else {
log.write(logMessageCode, logMessageArguments);
}
}
if (journal != null) {
journal.addInfo(exceptionJournalKey, th, exceptionEditorFinder);
}
if (httpResponseStatus != -1 && response instanceof HttpServletResponse) {
if (httpResponseStatusMessage == null) {
((HttpServletResponse) response).setStatus(httpResponseStatus);
} else {
((HttpServletResponse) response).sendError(httpResponseStatus, httpResponseStatusMessage);
}
}
if (responseObject != null || responseObjectServiceName != null) {
Object resObj = responseObject;
if (responseObjectServiceName != null) {
resObj = ServiceManagerFactory.getServiceObject(responseObjectServiceName);
}
if (exceptionAndResponseObjectPropertyMapping != null) {
Iterator entries = exceptionAndResponseObjectPropertyMapping.entrySet().iterator();
while (entries.hasNext()) {
Map.Entry entry = (Map.Entry) entries.next();
try {
Object val = propertyAccess.get(th, (String) entry.getKey());
if (val != null) {
propertyAccess.set(resObj, (String) entry.getValue(), val);
}
} catch (IllegalArgumentException e) {
} catch (NoSuchPropertyException e) {
} catch (InvocationTargetException e) {
}
}
}
request.setAttribute(responseObjectAttributeName, resObj);
}
if (isThrowException) {
throw th;
} else if (forwardPath != null) {
final RequestDispatcher rd = request.getRequestDispatcher(forwardPath);
if (rd != null) {
request.setAttribute(REQUEST_ATTIBUTE_EXCEPTION_KEY, th);
rd.forward(request, response);
}
} else if (redirectPath != null && response instanceof HttpServletResponse) {
((HttpServletResponse) response).sendRedirect(((HttpServletResponse) response).encodeRedirectURL(redirectPath));
}
}
use of jp.ossc.nimbus.beans.NoSuchPropertyException in project nimbus by nimbus-org.
the class PropertyWritableRecordFactoryService method getElementValue.
protected Object getElementValue(String key, Object elements, Map propMapping) {
if (propMapping != null && propMapping.containsKey(key)) {
final Logger logger = getLogger();
final Property prop = (Property) propMapping.get(key);
try {
return prop.getProperty(elements);
} catch (NoSuchPropertyException e) {
return null;
} catch (InvocationTargetException e) {
logger.write(PWRF_00001, key, e);
return null;
}
} else {
return super.getElementValue(key, elements);
}
}
Aggregations