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 27956 invoked from network); 14 Sep 2000 19:53:08 -0000 Received: from lukla.sun.com (192.18.98.31) by locus.apache.org with SMTP; 14 Sep 2000 19:53:08 -0000 Received: from engmail3.Eng.Sun.COM ([129.144.170.5]) by lukla.Sun.COM (8.9.3+Sun/8.9.3) with ESMTP id NAA11274 for ; Thu, 14 Sep 2000 13:53:07 -0600 (MDT) Received: from florence.eng.sun.com (florence.Eng.Sun.COM [129.144.251.146]) by engmail3.Eng.Sun.COM (8.9.3+Sun/8.9.3/ENSMAIL,v1.7) with ESMTP id MAA29277 for ; Thu, 14 Sep 2000 12:53:06 -0700 (PDT) Received: from eng.sun.com (localhost [127.0.0.1]) by florence.eng.sun.com (8.9.3+Sun/8.9.1) with ESMTP id MAA18396 for ; Thu, 14 Sep 2000 12:53:05 -0700 (PDT) Sender: craigmcc@florence.Eng.Sun.COM Message-ID: <39C12CA1.36ACDD79@eng.sun.com> Date: Thu, 14 Sep 2000 12:53:05 -0700 From: Craig McClanahan Organization: Sun Microsystems, Inc. X-Mailer: Mozilla 4.51 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: tomcat-user@jakarta.apache.org Subject: Re: JSP exception question...help needed References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Luis Andrei Cobo wrote: > my impression is that HashMap doesnt have the signature of a bean, therefore > I dont think it can be used as one. > > correct me if im wrong, but there are no empty contructors in hashMap ( > required for a java bean), and no set/get properties for bean scope > variables. > It turns out that, if you create a HashMap object and store it (say, as a request attribute) in a servlet and then forward to the JSP page, you won't have any problems -- the attribute will already be there, so the JSP page will not try to create it. > > Is there a particular reason why one would want to use HashMap as a bean > anyhow? > In the Struts framework I have some custom tags, among them one that knows how to iterate over various kinds of Collections, Maps, and arrays. In general, the Map interface exposes a "lookup table" concept that can be quite useful. > > Perhaps construct a bean which overrides HashMap Properties and methods, and > still contains a bean signature. > > Just curious > > Luis Andrei Cobo > Craig McClanahan