The ProgrammersTalk Community
Forum Register Search Today's Posts Mark Forums Read
Register

Go Back   The ProgrammersTalk Community > Web Programming > JSP


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:

Closed Thread
 
LinkBack Thread Tools    Display Modes   
  #1 (permalink)  
Old 06-10-2007, 04:09 PM
vestabs
Posts: n/a
[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.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
  #2 (permalink)  
Old 06-10-2007, 04:10 PM
Amit Y
Posts: n/a
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 .

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
  #3 (permalink)  
Old 06-10-2007, 04:11 PM
afrowoman
Posts: n/a
Try a different type of 'Beans' lol

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
  #4 (permalink)  
Old 06-10-2007, 04:11 PM
afrowoman
Posts: n/a
Try a different type of 'Beans' lol

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Closed Thread


Thread Tools
Display Modes

   Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 04:56 PM. Powered by vBulletin
Copyright © 2000 - 2007, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO © 2007 ProgrammersTalk Sedo - Buy and Sell Domain Names and Websites project info: programmerstalk.net Statistics for project programmerstalk.net etracker® web controlling instead of log file analysis


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50