English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

this is my program which is a part of a online shopping program:
add to cart
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="onlinestorebeans.Product" %>
<%@ page import="java.util.*" %>
<%
String pid = request.getParameter("PID");
String pname = request.getParameter("PNAME");
String price = request.getParameter("PPRICE");

Product p = new Product();
p.setId(Integer.parseInt(pid));
p.setName(pname);
p.setPrice(Double.parseDouble(price));
ArrayList basket = null;
if(session.getAttribute("basket") == null)
{
basket = new ArrayList();
}
else
{
basket = (ArrayList) session.getAttribute("basket");
}
basket.add(p)
session.setAttribute("basket", basket);
response.sendRedirect("shopping.jsp");
%>
my error:
An error occurred at line: 7 in the jsp file: /JSPcourse/jsp_shoppingcart/addtocart.jsp
Generated servlet error:
Product can't be resolved to a type.

2007-02-20 08:49:58 · 1 answers · asked by vestabs 1 in Computers & Internet Programming & Design

1 answers

I guess it is because the java been should be in WEB-INF/classes or in one of the jar files in WEB-INF/lib .

2007-02-20 09:19:26 · answer #1 · answered by Amit Y 5 · 0 0

fedest.com, questions and answers