public void doProcess(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
res.setContentType("application/json");
try {
ExpressionEditorMessageJSONMarshaller marshaller = new ExpressionEditorMessageJSONMarshaller();
ExpressionEditorMessageJSONUnmarshaller unmarshaller = new ExpressionEditorMessageJSONUnmarshaller();
ExpressionEditorMessage requestMessage = null;
ExpressionEditorMessage responseMessage = null;
PrintWriter out = res.getWriter();
String command = req.getParameter(COMMAND_PARAM);
String message = req.getParameter(MESSAGE_PARAM);
if (logger.isDebugEnabled()) {
logger.debug("Processing request for parameters, command: " + command + ", message: " + message);
}
if (!isValidCommand(command)) {
logger.error("Invalid command: " + command + " was sent to the ExpressionsEditorProcessor, " +
"request will be discarded.");
return;
}
try {
requestMessage = unmarshaller.unmarshall(message);
} catch (Exception e) {
logger.error("It was not possible to unmarshall json message, request will be discarded. message: " + message, e);
return;
}