本文整理了Java中org.glassfish.grizzly.http.server.Response.setDetailMessage
方法的一些代码示例,展示了Response.setDetailMessage
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.setDetailMessage
方法的具体详情如下:
包路径:org.glassfish.grizzly.http.server.Response
类名称:Response
方法名:setDetailMessage
[英]Sets detail error message.
[中]设置详细信息错误消息。
代码示例来源:origin: opentripplanner/OpenTripPlanner
response.setDetailMessage("path should have at least one part");
response.setDetailMessage("no job IDs were found");
if (task.jobId != exemplar.jobId || task.graphId != exemplar.graphId) {
response.setStatus(HttpStatus.BAD_REQUEST_400);
response.setDetailMessage(
"All tasks must be for the same graph and job.");
} else {
response.setStatus(HttpStatus.NOT_FOUND_404);
response.setDetailMessage(
"Context not found; should be either 'jobs' or 'priority'");
if (broker.deleteJob(pathComponents[2])) {
response.setStatus(HttpStatus.OK_200);
response.setDetailMessage("job deleted");
response.setDetailMessage("job not found");
response.setDetailMessage("Delete is only allowed for tasks and jobs.");
response.setDetailMessage("Unrecognized HTTP method.");
response.setDetailMessage("Could not decode/encode JSON payload. " + jpex.getMessage());
LOG.info("Error processing JSON from client", jpex);
} catch (Exception ex) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
response.setDetailMessage(ex.toString());
代码示例来源:origin: org.glassfish.main.web/web-core
/**
* Set the HTTP status and message to be returned with this response.
*
* @param status The new HTTP status
* @param message The associated text message
*
* @deprecated As of Version 2.1 of the Java Servlet API, this method
* has been deprecated due to the ambiguous meaning of the message
* parameter.
*/
public void setStatus(int status, String message) {
if (isCommitted())
return;
// Ignore any call from an included servlet
if (included)
return;
coyoteResponse.setStatus(status);
// use encoding in GlassFish
coyoteResponse.getResponse().setHtmlEncodingCustomReasonPhrase(false);
coyoteResponse.setDetailMessage(HtmlEntityEncoder.encodeXSS(message));
}
代码示例来源:origin: org.glassfish.main.web/web-core
/**
* Send an error response with the specified status and message.
*
* @param status HTTP status code to send
* @param message Corresponding message to send
*
* @exception IllegalStateException if this response has
* already been committed
* @exception IOException if an input/output error occurs
*/
public void sendError(int status, String message)
throws IOException {
if (isCommitted())
throw new IllegalStateException(rb.getString(LogFacade.CANNOT_CALL_SEND_ERROR_EXCEPTION));
// Ignore any call from an included servlet
if (included) {
return;
}
setError();
coyoteResponse.setStatus(status);
// use encoding in GlassFish
coyoteResponse.getResponse().setHtmlEncodingCustomReasonPhrase(false);
coyoteResponse.setDetailMessage(HtmlEntityEncoder.encodeXSS(message));
// Clear any data content that has been buffered
resetBuffer();
// Cause the response to be finished (from the application perspective)
setSuspended(true);
}
代码示例来源:origin: javaee/grizzly
} catch (CharConversionException e) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
response.setDetailMessage("Invalid URI: " + e.getMessage());
return true;
代码示例来源:origin: javaee/grizzly
} catch (CharConversionException e) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
response.setDetailMessage("Invalid URI: " + e.getMessage());
return true;
代码示例来源:origin: javaee/grizzly
} catch (CharConversionException e) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
response.setDetailMessage("Invalid URI: " + e.getMessage());
return true;
代码示例来源:origin: javaee/grizzly
} catch (CharConversionException e) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
response.setDetailMessage("Invalid URI: " + e.getMessage());
return true;
代码示例来源:origin: javaee/grizzly
} catch (CharConversionException e) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
response.setDetailMessage("Invalid URI: " + e.getMessage());
return true;
代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-http-server
} catch (CharConversionException e) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
response.setDetailMessage("Invalid URI: " + e.getMessage());
return true;
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server
} catch (CharConversionException e) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
response.setDetailMessage("Invalid URI: " + e.getMessage());
return true;
代码示例来源:origin: javaee/grizzly
} catch (CharConversionException e) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
response.setDetailMessage("Invalid URI: " + e.getMessage());
return true;
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core
} catch (CharConversionException e) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
response.setDetailMessage("Invalid URI: " + e.getMessage());
return true;
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
} catch (CharConversionException e) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
response.setDetailMessage("Invalid URI: " + e.getMessage());
return true;
代码示例来源:origin: javaee/grizzly
} catch (CharConversionException e) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
response.setDetailMessage("Invalid URI: " + e.getMessage());
return true;
内容来源于网络,如有侵权,请联系作者删除!