cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierpaolo Fumagalli <>
Subject Re: [Moving on] SAX vs. DOM part II
Date Mon, 24 Jan 2000 22:26:34 GMT
Tim Bray wrote:
> At 01:19 PM 1/24/00 -0800, Pierpaolo Fumagalli wrote:
> >> Er, well, I access web services (not only servlets but CGIs and PHPs and
> >> so on) all the time from the command line; the simplest way is with
> >> lwp-request, but there are lots of others.
> >
> >Isn't lwp-request that PERL script that contacts web sites saves URL to
> >the disk?
> Sends the URL data to standard output.

Welll... It doesn't differ... The socket have an InputStream, and an
OutputStream... What it does basically is "faking" a socket connection,
piping it to the standard input-output and go from there...
Request-Response... No changes :)

> >If it's that, so, there's always an HTTP request-response
> >involved, isn't it?
> Yes, but not visibly.

Regardeless of the transport (socket, pipes, streams...) the model
doesn't change? Don't you agree?

> >I was thinking about a CGI that needs to get parameters data, and that
> >is executed from the real command line:
> lwp-request can do that just fine.  Even with POST.

Yes, because they're HTTP requests on a different non-networked

> There's also a mode of lynx that does the same thing.

Cool :) I have to try it out.

> All I'm saying that simply being a servlet doesn't rule out
> command-line access.  I know that in the case of applet, there's some
> extra work in writing Java that works as both applet and app, and there
> are some surprising bugs you can get into.  I don't know if this is true
> in the case of servlet... if so, I might question whether it's worth doing
> the extra work to build in a main() and so on.  But since I'm a servlet
> virgin, don't weigh my opinion too heavily here. -Tim

Oh yes... Totally... Perfectly agreed. A servlet does not imply a
web-server with a network connection over a socket. What the servlet API
describes is a mode of operation that is following the HTTP model of
request response. As lwp-request emulates the same request-response
model using STDIN-STDOUT, we can apply the same model without involving
a Servlet Engine or a Web Server, but simply constructing those requests
and response objects from command line parameters and go from there.

I can think about abstracting a servlet out of its networked context,
but not out of its operation context, because that would not be a
servlet anymore.


-          P              I              E              R          -
stable structure erected over water to allow the docking of seacraft
<>    <>
- ApacheCON Y2K: Come to the official Apache developers conference -
-------------------- <> --------------------

View raw message