two things:
1) you have to import java.util.Hashtable
ie
<%@ page language="java" import="java.util.Hashtable" %>

look at the error, it says it tried to import jsp.jobs.Hashtable, that's the
hint you get to go import the proper class.

2) you have to 'new' the object in order to use it, otherwise you'll get a
NPE.


-----Original Message-----
From: shu-chun [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 22, 2000 8:00 AM
To: [EMAIL PROTECTED]
Subject: jsp hashtable


hi, i tried to defined and use a hashtable in the jsp page, like this:
<%! Hashtable hash_state; %>
<% hash_state.put("AK", "Alaska") %>

and it gave me the error like this
org.apache.jasper.JasperException: Unable to compile class for
JSP/usr/local/tomcat31/work/localhost_8080%2Fexamples/_0002fjsp_0002fjobs_00
02fjob_00031_0002ejspjob1_jsp_92.java:22: Class jsp.jobs.Hashtable not
found.

i am new at jsp. i am not srue if i can define a hashtable in the jsp page
itself, instead of in the beans? or if there is any document i can read?

thank you so much....

Lu

===========================================================================
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

Reply via email to