摘要:
需求:要让Tomcat在返回200、404等的HttpStatus时,附带自定义消息而不是默认的OK/Not Found。做法:修改catalina.properties配置文件,添加以下内容。org.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true在服务器端使用HttpServletResponse.sendError(int, String)发送HttpStatus和自定义消息。response.sendError(200, "You got the correct result!");要注意的是当自定义非英文数字的消 阅读全文
posted @ 2013-04-02 17:13
Reilee
阅读(482)
评论(0)
推荐(0)

浙公网安备 33010602011771号