(use '[clojure.contrib.server-socket :only (create-server)]
       '[clojure.contrib.duck-streams :only (read-lines)])
(create-server 8080
  (fn [in out] (when-not (empty? (read-lines in)) (spit out "Hello,
World!\n"))))
4/0/0

John

On Thu, Sep 9, 2010 at 9:21 PM, Matt <macourt...@gmail.com> wrote:
>> You cannot deploy a .clj script on a running Tomcat (yet).
>
> In the unstable 0.8 version of Conjure, you can create a war file by
> simply adding leiningen-war to your dev-dependencies and running "lein
> uberwar". You can then simply drop the war file into a Tomcat server.
> The web.xml file is already created for you with a default
> configuration which will work with your Conjure app out of the box. Of
> course, if the web.xml file doesn't do what you need, you can still
> edit it.
>
> The only reason I've not released 0.8 yet, is that I'm trying to make
> deployment on Google App Engine nearly as easy. Unfortunately, Google
> App Engine doesn't like all of the reflection stuff in Conjure.
>
> Obviously, Conjure is much slower and a lot more overhead than most of
> the other solutions mentioned in this thread.
>
> -Matt Courtney
>
>
> On Sep 9, 2:16 pm, Brenton <bashw...@gmail.com> wrote:
>> Mike,
>>
>> While evaluating Clojure, just remember, you don't have use it for
>> everything. When you need something simple, as in your examples, then
>> use cgi. When you need to do something more complex then Clojure can
>> help.
>>
>> You cannot deploy a .clj script on a running Tomcat (yet). When you
>> install Tomcat, you have a ROOT context into which you can place .html
>> and .jsp files and they will be dynamically loaded. This gives you
>> about the same functionality as you would get from php and apache.
>>
>> Even though Clojure doesn't already have what you are looking for it
>> would not be difficult to make it work. For example, you could create
>> a generic web app that would have an embedded REPL as well as the
>> ability to dynamically load code from external files. You would then
>> just need to install Tomcat (which is easy) and drop this war into it.
>> Form then on out you would just create simple .clj scripts and drop
>> them into a directory. You could also connect to the REPL and
>> dynamically add and remove code from the application. This hasn't been
>> done yet because I don't think many people would find it useful.
>>
>> Clojure is new so when you see something missing, build it. That is
>> why all of this other stuff is so simple, someone built it.
>>
>> Brenton
>>
>> On Sep 9, 10:40 am, Mike Meyer <mwm-keyword-googlegroups.
>>
>> 620...@mired.org> wrote:
>> > On Thu, 9 Sep 2010 09:41:09 -0700 (PDT)
>>
>> > Brenton <bashw...@gmail.com> wrote:
>> > > Mike,
>>
>> > > Your point has been made, simple things are simple. When you need to
>> > > print "hello world" you don't need to bring Clojure into the picture.
>> > > You could have given a much simpler example of needing to print "hello
>> > > world" on the command line. echo "hello world" is much simpler than
>> > > what you would need to do in Clojure.
>>
>> > The thing is, I'm evaluating clojure - that's what drags clojure into
>> > it. If I wasn't interested in using clojure, I'd never have asked the
>> > question. Printing "hello world" is just a simple, well-understood
>> > example application. There are *lots* of applications worth putting on
>> > the web that aren't much more complicated than that. I chose it to
>> > emphasis how much extra work the environment that clojure seems to be
>> > inextricably linked with adds.
>>
>> > > When faced with any problem to solve, you have to look at the tools
>> > > you have available and then determine what the simplest solution will
>> > > be. In your case, all of the software you need is already installed,
>> > > configured and running. So it's simple. If you gave me a system with
>> > > Tomcat installed, configured and running then I could do the exact
>> > > same thing. It has nothing to do with Java, it has to do with what you
>> > > are given to work with.
>>
>> > I thought I *gave* you all those things to work with when I said "not
>> > counting the web server and whatever else it needs to be ready to run
>> > applications." Could you show me (or point me to an web page showing)
>> > how I'd go from a simple .clj script to an application running on
>> > Tomcat that's been installed and is ready to run applications? If
>> > that's as simple as the apache/cgi example, I'll be very happy.
>>
>> >      <mike
>> > --
>> > Mike Meyer <m...@mired.org>          http://www.mired.org/consulting.html
>> > Independent Network/Unix/Perforce consultant, email for more information.
>>
>> > O< ascii ribbon campaign - stop html mail -www.asciiribbon.org
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to