Re: java built in HTTP server, proxy and HttpHandler interface

2008-12-09 Thread prhlava
Hello Steve, > It may be that *out* gets redirected. Another difference between out > and err is that System/err is often associated with an "autoflush" > stream. It's possible that your output to *out* has ben buffered and > that you need a call to (flush) to ensure it's displayed. Not calling

Re: java built in HTTP server, proxy and HttpHandler interface

2008-12-09 Thread Stephen C. Gilardi
On Dec 9, 2008, at 7:30 AM, prhlava wrote: > The > > (. java.lang.System/err println "something") > > works from in handler (it looks that *out* gets re-directed)... It may be that *out* gets redirected. Another difference between out and err is that System/err is often associated with an "aut

Re: java built in HTTP server, proxy and HttpHandler interface

2008-12-09 Thread prhlava
Well, The (. java.lang.System/err println "something") works from in handler (it looks that *out* gets re-directed)... Vlad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: java built in HTTP server, proxy and HttpHandler interface

2008-12-09 Thread prhlava
Hello Kyle, What got me started is java code on: http://www.java2s.com/Code/Java/JDK-6/LightweightHTTPServer.htm But what is strange that java code handler can print to console and clojure version (if run as a script) does not. How do you go about debugging the handler? Kind regards, Vlad -

Re: java built in HTTP server, proxy and HttpHandler interface

2008-12-08 Thread Kyle R. Burton
> I have gotten your example to work with a bit of reading and > modification (and thank you, I was after an example http server, this > got me going): A bit more hacking and it's possible to add/replace handlers after the server has been started: (import '(java.io IOException OutputStream) '

Re: java built in HTTP server, proxy and HttpHandler interface

2008-12-08 Thread Kyle R. Burton
On Mon, Dec 8, 2008 at 5:18 PM, prhlava <[EMAIL PROTECTED]> wrote: > > > Well, it turns out that the following works, but it only prints the > "exchange" to stdout, > if the code is cut and pasted to the REPL but _not_ if run as .clj > script)... I have gotten your example to work with a bit of r

Re: java built in HTTP server, proxy and HttpHandler interface

2008-12-08 Thread prhlava
Well, it turns out that the following works, but it only prints the "exchange" to stdout, if the code is cut and pasted to the REPL but _not_ if run as .clj script)... (import '(java.io IOException) '(java.io OutputStream) '(java.util Iterator) '(java.util List) '(java.util Set) '(com.sun.