Return-Path: Delivered-To: apmail-jakarta-avalon-phoenix-dev-archive@apache.org Received: (qmail 36521 invoked from network); 1 Oct 2002 07:25:46 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 1 Oct 2002 07:25:46 -0000 Received: (qmail 911 invoked by uid 97); 1 Oct 2002 07:26:39 -0000 Delivered-To: qmlist-jakarta-archive-avalon-phoenix-dev@jakarta.apache.org Received: (qmail 894 invoked by uid 97); 1 Oct 2002 07:26:38 -0000 Mailing-List: contact avalon-phoenix-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon-Phoenix Developers List" Reply-To: "Avalon-Phoenix Developers List" Delivered-To: mailing list avalon-phoenix-dev@jakarta.apache.org Received: (qmail 882 invoked by uid 98); 1 Oct 2002 07:26:38 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Subject: Re: Phoenix and the Web From: Bruno Dumon To: Avalon-Phoenix Developers List In-Reply-To: <3D98DAD7.20302@yahoo.com> References: <3D98225C.6010508@denic.de> <1033417926.21949.57.camel@yum> <3D98DAD7.20302@yahoo.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 01 Oct 2002 09:25:10 +0200 Message-Id: <1033457111.21960.77.camel@yum> Mime-Version: 1.0 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Tue, 2002-10-01 at 01:14, Paul Hammant wrote: > Bruno, hi there... > > I have a generalized Jetty block in progress: > cool Just wondering, how would you provide the webapplications with access to other blocks? By putting the component manager in the servlet context or so? > > http://cvs.apache.org/viewcvs/jakarta-avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/blocks/jetty/ > > The server starts but returns 404 pages for all invocations. > Can you see what is wrong? > No, but I have not yet tried deploying webapplications. I assume you're using the correct virtual host? > Also, how would I route Jetty logging thru to Phoenix? Like this: import org.mortbay.util.Log; ... Log.instance().add(new MyLogSink()); ... protected class MyLogSink implements LogSink { public void setOptions(String s) { } public String getOptions() { return ""; } public void log(String tag, Object message, Frame frame, long time) { logger.info(tag + " " + message); } public void log(String formattedLog) { logger.info(formattedLog); } public void start() throws Exception { } public void stop() throws InterruptedException { } public boolean isStarted() { return true; } } > > Regards, > > - Paul > > >I'm using Jetty in a phoenix-based project. Embedding it is just a > >matter of a few lines of code, here's a small sample program: > > > >import org.mortbay.util.InetAddrPort; > >import org.mortbay.http.*; > >import org.mortbay.http.handler.AbstractHttpHandler; > > > >import java.io.OutputStreamWriter; > >import java.io.Writer; > >import java.io.IOException; > > > >public class Test > >{ > > public static void main(String[] args) > > throws Exception > > { > > HttpServer server = new HttpServer(); > > HttpContext context = server.getContext(null, ""); > > context.addHandler(new AbstractHttpHandler() > > { > > public void handle(String s, String s1, HttpRequest request, > >HttpResponse response) throws HttpException, IOException > > { > > try > > { > > response.setStatus(HttpResponse.__200_OK); > > response.setContentType("text/xml"); > > Writer writer = new > >OutputStreamWriter(response.getOutputStream()); > > writer.write("hello"); > > writer.flush(); > > response.commit(); > > } > > catch (Exception e) > > { > > e.printStackTrace(); > > } > > } > > }); > > server.addListener(new InetAddrPort(8888)); > > server.start(); > > } > >} > > > >Of course, in a phoenix block you would create the server in the > >initialize method, and start and stop it in the start/stop methods of > >the Startable interface. It's also possible to redirect jetty's log to > >an avalon logger. It would probably also be possible to embed jetty's > >servlet container, if you don't like extending from AbstractHttpHandler. > > > >You can find out more about jetty at http://jetty.mortbay.org > > > >On Mon, 2002-09-30 at 12:07, Ulrich Mayring wrote: > > > > > >>Hello folks, > >> > >>given my recent (unsuccessful) endeavour of getting Jo! to run under Phoenix, I > >>began to wonder what a connection between Phoenix and the Web could/should look > >>like. I think it is imperative for a server application framework and an > >>applicaton server to be able to serve the Web. > >> > >>Here are some options I can think of: > >> > >>1) There is a class called PhoenixServlet, but it is labelled as experimental. > >>It does not seem to do very much either. What is its purpose? > >> > >>2) Jo! and Sevak can run servlets, but they have no native way to communicate > >>with other apps (except via AltRMI or similar methods). I don't think it is > >>possible to persuade the developers of Jo! or Catalina to componentize their > >>designs to accommodate Avalon/Phoenix. But everything else is just a hack. > >> > >>3) How about an ajpv12 or ajpv13 component? Maybe the code can be nicked from > >>Catalina and repackaged as a component. Then every Phoenix app could just use > >>that component and be fully connected to everyone who supports mod_jk or > >>mod_jserv (mainly the Apache httpd, but also some other webservers). > >> > >>4) MX4J already has a HTTPConnector, but it is fairly limited to JMX. But we > >>just need a way to pass control to an arbitrary app and give back a response, > >>maybe it can be done with MX4J? > >> > >>5) Development of a HTTP component. It does not need to be a full-blown > >>webserver, we just need to speak HTTP. For access control, URL rewriting, error > >>handling and all those other fancy features we could rely on an external > >>webserver and assume that he makes sure to forward only "safe and appropriate" > >>HTTP requests to us for backend processing. Connections have to be limited to > >>that webserver, though. Most webservers have a way to forward HTTP requests to > >>another webserver. > >> > >>Any other ideas/comments? I like option 3) best. > >> > >>cheers, > >> > >>Ulrich > >> > >> > > > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: -- Bruno Dumon http://outerthought.org/ Outerthought - Open Source, Java & XML Competence Support Center bruno@outerthought.org -- To unsubscribe, e-mail: For additional commands, e-mail: