this is my code, it seems right to me! i don't know why it keeps saying this:
"Cannot instantiate the type Iterator"
this is the servlet:
package uges.servlets;
import jess.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.Iterator;
public class Catalog extends BaseServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
checkInitialized();
try {
String customerId =
(String) request.getParameter("customerId");
if (customerId == null || customerId.length() == 0) {
dispatch(request, response, "/index.html");
return;
}
request.getSession().invalidate();
HttpSession session = request.getSession();
session.setAttribute("customerId", customerId);
session.setAttribute("orderNumber",
String.valueOf(getNewOrderNumber()));
ServletContext servletContext = getServletContext();
Rete engine = (Rete) servletContext.getAttribute("engine");
Iterator result =
engine.runQuery("all-products", new ValueVector());
request.setAttribute("queryResult", result);
} catch (JessException je) {
throw new ServletException(je);
}
dispatch(request, response, "/catalog.jsp");
}
this is the dispatch method, it 's in a servlet called BaseServlet:
protected void dispatch(HttpServletRequest request,
HttpServletResponse response,
String page)
throws IOException, ServletException {
ServletContext servletContext = getServletContext();
RequestDispatcher dispatcher =
servletContext.getRequestDispatcher(page);
dispatcher.forward(request, response);
}
and this the JSP code:
<HTML>
<%@ page import="jess.*" %>
<jsp:useBean id="queryResult" class="java.util.Iterator" scope="request"/>
the error is about the java.util.Iterator in the class type of useBean tag!
the exception says : The value for the useBean class attribute java.util.Iterator is invalid
any help please ..
Thanks in advance!