// prepare response content
byte[] responseContent = null;
if (ajaxMode) {
- MJsonObject returnValue = null;
try {
+ MJsonObject returnValue = null;
returnValue = new MJsonObject();
returnValue.setValue("errorMode", new MJsonNumber("" + MWebApplicationServlet.ErrorMode.CLEAN.ordinal()));
MJsonString jsonParameter = new MJsonString();
jsonParameter.setValue(new String(content, MInformation.TEXT_ENCODING));
returnValue.setValue("parameter", jsonParameter);
+ responseContent = returnValue.getJsonValue().getBytes(MInformation.TEXT_ENCODING);
}
catch (MInvalidValueJsonException exception) { // cannot happen
}
- responseContent = returnValue.getJsonValue().getBytes(MInformation.TEXT_ENCODING);
}
else {
responseContent = content;
try {
if (MWebApplicationServlet.ErrorMode.DEBUG == errorMode) {
if (ajaxMode) {
- MJsonObject returnValue = null;
try {
+ MJsonObject returnValue = null;
returnValue = new MJsonObject();
returnValue.setValue("errorMode", new MJsonNumber("" + errorMode.ordinal()));
MJsonString jsonParameter = new MJsonString();
jsonParameter.setValue(content.getClass().getName());
}
returnValue.setValue("parameter", jsonParameter);
+ responseContent = returnValue.getJsonValue().getBytes(MInformation.TEXT_ENCODING);
}
catch (MInvalidValueJsonException exception) { // should not happen
}
- responseContent = returnValue.getJsonValue().getBytes(MInformation.TEXT_ENCODING);
}
else {
if (null != content.getMessage()) {