Thanks, everybody!
I'm getting there...but just one other thing.
What if I override init(), like this:
private Product p = null;
public synchronized void init() throws ServletException
{
p = new Product();
}
public synchronized void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
{
res.setContentType("text/html");
out = res.getWriter();
out.println("<html><head><title>Welcome to CASEMAN</title>"+
"<LINK REL=stylesheet HREF=\"/css/Caseman.css\""+
" TYPE=\"text/css\"></head><body bgcolor=#f5f5f5><center>"+
"<h1>Welcome to Caseman</h1>"+
"<table width=600 border=0 CELLPADDING=0 CELLSPACING=3 CLASS=\"Rub\">"+
"<tr><td colspan=2><hr></td></tr><tr><td width=300 align=right>Select Country or Product:</td>"+
"<td width=300 align=left><FORM action=\"/caseman/list\"><SELECT NAME=product>");
Enumeration enum = p.getAllProducts().keys();
while(enum.hasMoreElements())
{
String productId = (String)enum.nextElement();
String pname = (String)p.getAllProducts().get(productId);
int pid = Integer.parseInt(productId);
out.println("<option value =\""+ pid +"\">"+ pname +"</option>");
}
out.println("<option value =\"0\">"+"All Cases"+"</option>"+
"</select><input type=submit value=Go!></td><tr><td colspan=2><hr></td></FORM></CENTER></body></html>");
out.close();
}
}
Wouldn't this be threadsafe???