Added a request-restart-wrapper and some convenient redirections.
[jsvc.git] / src / dolda / jsvc / RequestThread.java
index c6b9373..51f9d86 100644 (file)
@@ -12,6 +12,15 @@ public class RequestThread extends Thread {
     
     public void run() {
        resp.respond(req);
+       try {
+           req.output().close();
+       } catch(java.io.IOException e) {
+           throw(new RuntimeException(e));
+       }
+    }
+    
+    public static ServerContext context() {
+       return(((RequestThread)Thread.currentThread()).req.ctx());
     }
     
     public static Request request() {