Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 92730 invoked from network); 23 Jan 2003 18:21:18 -0000 Received: from exchange.sun.com (192.18.33.10) by 208.185.179.12.available.above.net with SMTP; 23 Jan 2003 18:21:18 -0000 Received: (qmail 26398 invoked by uid 97); 23 Jan 2003 18:22:25 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 26378 invoked by uid 97); 23 Jan 2003 18:22:25 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 26363 invoked by uid 98); 23 Jan 2003 18:22:24 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <3E3031FE.6050809@ptc.com> Date: Thu, 23 Jan 2003 13:18:38 -0500 From: Erik Price User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomcat Users List Subject: Re: servlets that forward to other servlets References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 23 Jan 2003 18:18:38.0743 (UTC) FILETIME=[D9E3B270:01C2C30B] X-Spam-Rating: 208.185.179.12.available.above.net 1.6.2 0/1000/N X-Spam-Rating: 208.185.179.12.available.above.net 1.6.2 0/1000/N Shapira, Yoav wrote: > Hi, > If it were a universal bad idea, it probably wouldn't be available as an > options ;) Although that may just be wishful thinking on my part. > > It's not always a bad idea. As usual, if you share your design and give > some more concrete details, we may be able to help more. Good point -- here's the scenario: My initial design was to have servlets perform all processing of user input, and each servlet redirects to a JSP to display the HTML to the user. Unfortunately, I've found that sendRedirect() is not sufficient, since complex objects cannot easily be sent to the JSP as HTTP parameters. Thus, I've decided to use getRequestDispatcher(some.jsp).forward() instead of sendRedirect(), since I can refer back to a complex object set in the servlet from the "receiving" JSP. The only problem is that sometimes a servlet needs to forward to another servlet, for instance LoginServlet needs to forward to MainServlet. Most of the time, the user is already logged in and so does not need to use LoginServlet at all, but the first time they enter the application they will need to confront LoginServlet before confronting MainServlet. So LoginServlet will need to forward to MainServlet, yada yada. > If you're > getting into a lot of request dispatchers, perhaps you should > investigate a framework like struts. I have no experience with struts, but everyone keeps talking about it. It seems worth learning, but I thought I'd try to write one complete basic webapp using only JSP + servlets first before going on to learn any frameworks, just for the sake of learning and so that I'd appreciate a proper framework more when someday I do use one. Thanks, Erik -- To unsubscribe, e-mail: For additional commands, e-mail: