From owner-freebsd-java Thu Dec 16 14:34:21 1999 Delivered-To: freebsd-java@freebsd.org Received: from cbl-skelly3.hs.earthlink.net (CBL-skelly3.hs.earthlink.net [209.178.114.61]) by hub.freebsd.org (Postfix) with ESMTP id 399DE14C39 for ; Thu, 16 Dec 1999 14:34:19 -0800 (PST) (envelope-from kelly@ad1440.net) Received: from ad1440.net (uta003594.jpl.nasa.gov [128.149.211.36]) by cbl-skelly3.hs.earthlink.net (8.9.2/8.9.2) with ESMTP id OAA29710; Thu, 16 Dec 1999 14:34:12 -0800 (PST) (envelope-from kelly@ad1440.net) Message-ID: <38596944.D573D5D1@ad1440.net> Date: Thu, 16 Dec 1999 14:35:48 -0800 From: Sean Kelly X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: Joe Yandle Cc: java@freebsd.org Subject: Re: Servlet runners for FreeBSD ( + Apache) References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > This is only half true. While it does allow you to do , that > doesn't help your servlets any. For example, when writing servlet/jsp > software I use the RequestDispatcher.forward() method to pass parameters > from my servlets to my JSPs (separate logic, data, and > presentation). However, since the servlet-2.0 spec doesn't allow for > this, my servlets can't do it. That's right. That's why I said I could do 1.0 JSP development, but only 2.0 servlet development. :-( Here's a trick I'm not particularly proud of to get around the lack of RequestDispatcher.forward() ... make sure you haven't eaten anything before reading below: public void doGet(...) { ... // create one or more beans and insert into user's session for later // use by the JSP file. ... out.println(""); out.println(""); out.println(" "); out.println(" Disgusting Trick"); out.println(" "); out.println(" ); out.println(" "); out.println(" <body>"); out.println(" <p>No 2.2 servlets means you have to have frames.</p>"); out.println(" </body>"); out.println(" "); out.println(" "); out.println(""); ... } Basically, you force the client browser to do a separate GET/POST to fetch the JSP page that the servlet could otherwise have forwarded to it with the forward() method. Worse, Netscape requires there to be at least two frames in a framed HTML document, so you have to change the rows="*" to rows="*, 0" to get the inner frame to go back to the web server and fetch the JSP file. Yuck. (I hate to say this, but IE's adherence to the 4.0 HTML specs has been a lot better than Netscape's.) Client redirection could also do it, too. Take care. --Sean To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message