I use my program JavaBeans in JSP, it does not work? This is my program which is part of a program to purchase online:
Add to <title> <panier / title>
> <% @ 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 cart = null;
if (session.getAttribute ("cart") == null)
(
cart = new ArrayList ();
)
else
(
cart = (ArrayList) session.getAttribute ("cart");
)
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.js ...
Generated servlet error:
Product can not be resolved to a type.
I guess it was because the java should be in WEB-INF/classes or in a jar files in WEB-INF/lib.
Posted on February 22, 2010.