From 108a8e9dca51c71828d74a928b29829589f87011 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Tue, 26 Mar 2013 23:36:18 +1100 Subject: [PATCH] 404326 set status when Request.setHandled(true) is called --- .../main/java/org/eclipse/jetty/embedded/LikeJettyXml.java | 4 ++-- jetty-server/src/main/config/etc/jetty-requestlog.xml | 2 +- .../java/org/eclipse/jetty/server/AbstractNCSARequestLog.java | 1 + .../src/main/java/org/eclipse/jetty/server/Request.java | 3 +++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java index ec27c98fed0..b30373e310c 100644 --- a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java +++ b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java @@ -150,11 +150,11 @@ public class LikeJettyXml // === jetty-requestlog.xml === NCSARequestLog requestLog = new NCSARequestLog(); - requestLog.setFilename(jetty_home + "/logs/jetty-yyyy_mm_dd.log"); + requestLog.setFilename(jetty_home + "/logs/yyyy_mm_dd.request.log"); requestLog.setFilenameDateFormat("yyyy_MM_dd"); requestLog.setRetainDays(90); requestLog.setAppend(true); - requestLog.setExtended(false); + requestLog.setExtended(true); requestLog.setLogCookies(false); requestLog.setLogTimeZone("GMT"); RequestLogHandler requestLogHandler = new RequestLogHandler(); diff --git a/jetty-server/src/main/config/etc/jetty-requestlog.xml b/jetty-server/src/main/config/etc/jetty-requestlog.xml index 247997e3069..6e6eb054f0c 100644 --- a/jetty-server/src/main/config/etc/jetty-requestlog.xml +++ b/jetty-server/src/main/config/etc/jetty-requestlog.xml @@ -19,7 +19,7 @@ yyyy_MM_dd 90 true - false + true false GMT diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNCSARequestLog.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNCSARequestLog.java index db78968d42c..5223e970049 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNCSARequestLog.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNCSARequestLog.java @@ -84,6 +84,7 @@ public abstract class AbstractNCSARequestLog extends AbstractLifeCycle implement * * @see org.eclipse.jetty.server.RequestLog#log(org.eclipse.jetty.server.Request, org.eclipse.jetty.server.Response) */ + @Override public void log(Request request, Response response) { try diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java index a04b74d42bc..f2518ff90cb 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java @@ -1768,6 +1768,9 @@ public class Request implements HttpServletRequest public void setHandled(boolean h) { _handled = h; + Response r=getResponse(); + if (_handled && r.getStatus()==0) + r.setStatus(200); } /* ------------------------------------------------------------ */