Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 28951 invoked from network); 10 Aug 2000 19:48:10 -0000 Received: from web1002.mail.yahoo.com (128.11.23.92) by locus.apache.org with SMTP; 10 Aug 2000 19:48:10 -0000 Received: (qmail 20909 invoked by uid 60001); 10 Aug 2000 19:48:06 -0000 Message-ID: <20000810194806.20907.qmail@web1002.mail.yahoo.com> Received: from [204.254.32.135] by web1002.mail.yahoo.com; Thu, 10 Aug 2000 12:48:05 PDT Date: Thu, 10 Aug 2000 12:48:05 -0700 (PDT) From: "David M. Holmes" Subject: Bean instantiation question To: tomcat-user@jakarta.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N I have some beans that implement a base type. I would like to instantiate the correct type of bean based on the request. The following will not work, "Variable 'ws' is already defined in this method." Is there a way to do this? rateworksheets.RateWorksheet ws; switch ( Integer.parseInt(request.getParameter("rate")) ) { case 0: %> <% application.getRequestDispatcher("/rateworksheets/reports/LGS.jsp").forward(request, response); break; case 1: %> <% application.getRequestDispatcher("/rateworksheets/reports/MGS.jsp").forward(request, response); break; } __________________________________________________ Do You Yahoo!? Kick off your party with Yahoo! Invites. http://invites.yahoo.com/