Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 91497 invoked by uid 500); 2 Jul 2001 00:44:46 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: tomcat-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 91489 invoked from network); 2 Jul 2001 00:44:45 -0000 Received: from dion.sprucegrove.com (HELO sprucegrove.com) (204.171.100.244) by h31.sny.collab.net with SMTP; 2 Jul 2001 00:44:45 -0000 Received: (from jay@localhost) by sprucegrove.com (8.11.0/8.11.0) id f620eAk27255; Sun, 1 Jul 2001 20:40:10 -0400 From: "D. Jay Newman" Message-Id: <200107020040.f620eAk27255@sprucegrove.com> Subject: Re: [tomcat-user] how to use generic servlets To: tizzy@darrintisdalecom Date: Sun, 1 Jul 2001 20:40:10 -0400 (EDT) Cc: tomcat-user@jakarta.apache.org In-Reply-To: <01070120385901.00930@loki> from "M. Darrin Tisdale" at Jul 01, 2001 08:38:59 PM X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N I'm sorry, but I agree with Nick. My reading of the servlet standard does not force the protocol to be HTTP. Theoretically the protocol could be anything that you want. You should be able to rewrite sendmail using servlets (why, I don't know, but it should be able to be done according to my understanding of the standard). If this isn't being done for Tomcat, I volunteer to write a generic connector-without-protocol. So many people consider servlets and HTTP to be intimately connected, and yet I think that is an accident of fate rather than part of the standard. (I'm not being altruistic about volunteering -- I also need to have a servlet without a known protocol and for the reasons that "tizzy?" suggests it would be better to use a servlet rather than rewrite the server engine.) I will reread the servlet spec tonight and make sure that non-HTTP protocols are part of the spec. > On Sunday 01 July 2001 01:05 pm, you wrote: > > Hi, > > all the literature i have just deals with HttpServlets and stuff, and > > anyway: its not much literature. > > > > could someone give me a nice example how to write a web.xml in which i > > can use my generic servlet which uses my own protocol? > > > > tia, > > > > nick > > web.xml is a standard file used by all servlet-powered systems. You can find > the spec for it at the sun web site, where the servlet specification is > housed: > http://java.sun.com/products/servlet/download.html > (Available in many formats) > > Now, although your message was a bit ambiguous, if you use servlets, you must > adhere to HTTP protocol specifications. > > You can still process the HTTP message using the service rather than doGet or > doPost calls if you wanna get closer to the implementation. It is still HTTP > though. > > If you want another port, set it up in the tomcat or apache port listener. > Servlets can run on any port. They are bound to their environment's ports, > through the web server instance. > > You can enclose any data you wish in the transaction, but the proper HTTP > headers and the like must be used by your protocol. If it does not use HTTP, > then I suggest you write a socket server (in Java it's cake) and use your own > protocol. You'll have to do a lot to get load balancing, etc., so you might > wanna consider just enabling it in HTTP. > > -- > > . . . tizzy > L'enfers, c'est les autres. > --Jean Paul Sartre, Huit Clos > -- D. Jay Newman ! For the pleasure and the profit it derives jay@sprucegrove.com ! I arrange things, like furniture, and http://www.sprucegrove.com/~jay/ ! daffodils, and ...lives. -- Hello Dolly