Sachin,
Ah, you caught my little example blunder.
Unfortunately, in the actual code, the hastable is in fact instantiated. The real
code was a little long and complicated, so for my post I distilled it into
something that just described the casting problem.
But hey, thanks for being awake! ;)
George
"Sachin S. Khanna" wrote:
> One Observation :
> You donot instantiate the myVec object in your code, that means you
> are trying to call the add method on a null object which is going to throw a
> NPE.
> Instantiating the myVec object might just bring an end to your grief :-).
> Have a nice day.
> With regards,
> Sachin S. Khanna.
> www.emailanorder.com
> ----- Original Message -----
> From: George Ludwig <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, June 29, 2000 12:26 AM
> Subject: bug with array casting within a JSP process
>
> > I have a javabean that's called from a JSP page. The bean compiles fine,
> but at
> > runtime JSP fails with no real explanation. The method code is something
> like
> >
> > Vector myVec ;
> >
> > MyCustomObject mco = new MyCustomObject() ;
> >
> > myVec.add(mco) ;
> >
> > Object[] o = myVec.toArray() ;
> >
> > return (MyCustomObject)o ;
> >
> > I'm pretty sure I've done this before in other cases, but in JSP it just
> fails.
> > BTW, it fails in both the JSWDK as well as WebLogic (both under Linux
> 6.1).
> >
> > Obviously, I worked around it be just returning the array without casting
> it, then
> > casting each array element as I used it. But that's not clean and it
> pisses me off.
> >
> > Is this a known bug? Where can I report it if it is?
> >
> > Cheers,
> >
> > George
> >
> >
> ===========================================================================
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets