![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Tags: |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |||
| [SOLVED] I use javabeans in my jsp program, it doesn't work? this is my program which is a part of a online shopping program: <title>add to cart</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 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. |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |