tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Horowitz <rhorow...@ni4u.com>
Subject Re: JSP exception question...help needed
Date Thu, 14 Sep 2000 21:25:40 GMT
This did not turn out to be the problem...btw HashMap does have an empty
constructor. If I were using a taglib, I'd be more concerned with this
being a proper bean, perhaps, but the problem turned out to be the need
to use:

<jsp:useBean id="errorsMap" class="java.util.HashMap" scope="request"/>

instead of..

<jsp:useBean id="errorsMap" class="HashMap" scope="request"/>

weird!

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.
> 
> Is there a particular reason why one would want to use HashMap as a bean
> anyhow?
> 
> Perhaps construct a bean which overrides HashMap Properties and methods, and
> still contains a bean signature.
> 
> Just curious
> 
> Luis Andrei Cobo
> 
> -----Original Message-----
> From: William Brogden [mailto:wbrogden@bga.com]
> Sent: Thursday, September 14, 2000 3:27 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: JSP exception question...help needed
> 
> Rick Horowitz wrote:
> >
> > Unfortunately, that did not help. I already have java.util.* on the
> > imports. Thanks anyway for trying :) Anybody else have any idea why I'm
> > seeing the problem outlined below?
> >
> > TIA...Rick Horowitz
> 
> In spite of the fact that you have included java.util.HashMap, you
> still have to give the complete package in your JSP tag
> 
>  <jsp:useBean id="errorsMap" class="java.util.HashMap" scope="request"
> />
> 
> > > > javax.servlet.ServletException:  Cannot create bean of class HashMap
> > > >       at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:386)
> > > >       at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > > >       at
> 
> --
> WBB - wbrogden@bga.com  Chief Scientist, LANWrights, Inc.
> Java Programmer Certification information and mock exam
> at  http://www.lanw.com/java/javacert/

Mime
View raw message