Hi All,
Horay to the 1.0 spec ! Now onto more mundane (0.92) problems.....
I use the following to return array of Strings in the getXxx( ) method
for an indexed bean propery :
return (String[]) consultantList.toArray( );
where the consultantList is a standard (1.2) Vector. When I do this I
get the following error in the browser window :
Unhandled error! You might want to consider having an errorpage to
report
such errors more gracefully
javax.servlet.ServletException: Exception nullwas thrown when accessing
HelpDesk:consultantList
at jsp.JspRuntimeLibrary.readArrayProperty(Compiled Code)
at jsp._samples_HelpDesk_HelpDesk.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at
sun.servlet.http.HttpServerHandler.callServlet(HttpServerHandler.java:21
2)
at
sun.servlet.http.HttpServerHandler.sendResponse(HttpServerHandler.java:1
54)
at
sun.servlet.http.ResourceDispatcherImpl.forward(ResourceDispatcherImpl.j
ava:49)
at jsp.JspServlet.processJspPage(JspServlet.java:183)
at jsp.JspServlet.service(JspServlet.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at
sun.servlet.http.HttpServerHandler.callServlet(HttpServerHandler.java:21
2)
at
sun.servlet.http.HttpServerHandler.sendResponse(HttpServerHandler.java:1
61)
at
sun.servlet.http.HttpServerHandler.handleConnection(HttpServerHandler.ja
va:125)
at
sun.servlet.http.HttpServerHandler.run(HttpServerHandler.java:94)
at java.lang.Thread.run(Thread.java:479)
There are no compilation problems reported on stdout, and the trace
messages in my bean indicate the error occurs on the return statement.
If I change the getXxx( ) method to use an array of strings directly
(instead of converting to one from the vector), it is fine. Also, if I
use the similar (but weird) Vector method :
return (String[]) consultantList.toArray (new String[0]);
it works fine. I don't even really understand the use of the above
method anyway, but it seems to work. Has anyone else come across this
problem with the Vector.toArray( ) method and JSP ?
I am using the Sun 0.92 reference implementation on Windows 95.
Thanks
Drew Cox
Barrack Consulting
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".