Small corrections
This commit is contained in:
@@ -32,7 +32,6 @@ public class XPathController implements RestController {
|
|||||||
|
|
||||||
@ScopedControllerManifest(method = HandlerType.POST, path = "/xpath")
|
@ScopedControllerManifest(method = HandlerType.POST, path = "/xpath")
|
||||||
public void acceptRequest(Request request, Response response) {
|
public void acceptRequest(Request request, Response response) {
|
||||||
|
|
||||||
XMLRequestBody requestBody;
|
XMLRequestBody requestBody;
|
||||||
try {
|
try {
|
||||||
requestBody = this.gson.fromJson(request.body(), XMLRequestBody.class);
|
requestBody = this.gson.fromJson(request.body(), XMLRequestBody.class);
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class XQueryController implements RestController {
|
|||||||
long duration = System.currentTimeMillis() - timeStart;
|
long duration = System.currentTimeMillis() - timeStart;
|
||||||
responseBody = new XMLResponseBody(result, "OK", engine.getVersion(), duration);
|
responseBody = new XMLResponseBody(result, "OK", engine.getVersion(), duration);
|
||||||
|
|
||||||
this.logger.info("Request (XQuery, " + engine.getVersion() + " processed in " + duration + " ms.");
|
this.logger.info("Request (XQuery, " + engine.getVersion() + ") processed in " + duration + " ms.");
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
response.status(400);
|
response.status(400);
|
||||||
responseBody = prepareErrorResponse(ex.getMessage(), engine.getVersion());
|
responseBody = prepareErrorResponse(ex.getMessage(), engine.getVersion());
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ public class XsdController implements RestController {
|
|||||||
}
|
}
|
||||||
@ScopedControllerManifest(method = HandlerType.POST, path = "/xsd")
|
@ScopedControllerManifest(method = HandlerType.POST, path = "/xsd")
|
||||||
public void acceptRequest(Request request, Response response) {
|
public void acceptRequest(Request request, Response response) {
|
||||||
|
|
||||||
XMLRequestBody requestBody = null;
|
XMLRequestBody requestBody = null;
|
||||||
try {
|
try {
|
||||||
requestBody = this.gson.fromJson(request.body(), XMLRequestBody.class);
|
requestBody = this.gson.fromJson(request.body(), XMLRequestBody.class);
|
||||||
|
|||||||
@@ -30,11 +30,9 @@ public class XsltController implements RestController {
|
|||||||
}
|
}
|
||||||
@ScopedControllerManifest(method = HandlerType.POST, path = "/xslt")
|
@ScopedControllerManifest(method = HandlerType.POST, path = "/xslt")
|
||||||
public void acceptRequest(Request request, Response response) {
|
public void acceptRequest(Request request, Response response) {
|
||||||
String body = request.body();
|
|
||||||
|
|
||||||
XMLRequestBody requestBody;
|
XMLRequestBody requestBody;
|
||||||
try {
|
try {
|
||||||
requestBody = this.gson.fromJson(body, XMLRequestBody.class);
|
requestBody = this.gson.fromJson(request.body(), XMLRequestBody.class);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
XMLResponseBody responseBody = prepareErrorResponse(e.getMessage(), "N/A");
|
XMLResponseBody responseBody = prepareErrorResponse(e.getMessage(), "N/A");
|
||||||
|
|
||||||
@@ -72,7 +70,7 @@ public class XsltController implements RestController {
|
|||||||
long duration = System.currentTimeMillis() - timeStart;
|
long duration = System.currentTimeMillis() - timeStart;
|
||||||
responseBody = new XMLResponseBody(result, "OK", engine.getVersion(), duration);
|
responseBody = new XMLResponseBody(result, "OK", engine.getVersion(), duration);
|
||||||
|
|
||||||
this.logger.info("Request (XSLT, " + engine.getVersion() + "processed in " + duration + " ms.");
|
this.logger.info("Request (XSLT, " + engine.getVersion() + ") processed in " + duration + " ms.");
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
responseBody = prepareErrorResponse(ex.getMessage(), engine.getVersion());
|
responseBody = prepareErrorResponse(ex.getMessage(), engine.getVersion());
|
||||||
response.status(400);
|
response.status(400);
|
||||||
|
|||||||
Reference in New Issue
Block a user