cannot be resolved to a type 老兄; 我在显示页面(.jsp)添加<%CustomerBean bean1=(CustomerBean)session.getAttribute("currentCustomer");%>这句话时会出现这样的提示:CustomerBean cannot be resolved to a type 我很急的,谢谢!
我是从servlet跳到到这个页面的以下是servlet的代码; public class BankServlet extends HttpServlet {
/** * The doGet method of the servlet. <br> * * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session=request.getSession(); response.setContentType("text/html"); PrintWriter out = response.getWriter(); String userID=request.getParameter("id"); BankModel bankmodel=new BankModel(); List customerlist=null; CustomerBean currentCustomer=new CustomerBean();//当前的用户 double balance=0;//当前用户的余额 customerlist= bankmodel.getCustomers(); String id; if(userID!=null){ for(int i=0;i<customerlist.size();i++){ CustomerBean bean=(CustomerBean)customerlist.get(i); id=bean.getUserID();//获取id if(id.equals(userID)){ balance=bean.getBalance(); String username=bean.getUserName(); currentCustomer.setUserName(username); currentCustomer.setBalance(balance);//double currentCustomer.setUserID(id); session.setAttribute("currentCustomer",currentCustomer ); break; }