Hey guys
I asked earlier also pls solve my problem
Actually I'm working on a shopping cart using JSP and SQL Server and I'm
also very new to JSP..
Now this is my first page on which I'm showing all  the products and have a
link which is called add to cart
and what I want is that when I click on that link it should refresh the same
page and it should  show me the book_id on which the user has clicked but
I'm not able to show that Pls help me out in this as it is very very urgent:

my jsp code is :
<%@page language="java" import="java.util.*"%>

<%@page import="shop.disBean"%>

<HTML>
<HEAD>
<TITLE>
Display Products
</TITLE>
</HEAD>
<BODY topmargin="0" leftmargin="0">
<table cellspacing="2" cellpadding="2" border="1">
<tr>
List of Book
<table border="3">
<tr>
<td>Book Name</td>
<td>Price</td>
<td>Publisher</td>
<td>CD</td>
<td>Category Name</td>
<td>Buy</td>
</tr>
<%--int ibook_id;--%>
<% Vector vect=new Vector();
    disBean disB=new disBean();
    disB.connect();
    vect=disB.query();
  int size=vect.size();

    for(int i=0;i<size;i++)
    {
    Object refObj=vect.elementAt(i);
    disBean strRecord=(disBean) refObj;

  %>
<tr>
<td><%= strRecord.getBook_name()%></a></td>
<td><%= strRecord.getPrice()%></td>
<td><%= strRecord.getPublisher() %></td>
<td><%= strRecord.getCd() %></td>
<td><%= strRecord.getCategory_name() %></td>
<td><a href="dis.jsp?book_id=<%=strRecord.getBook_id()%>">add to
cart</a></td>
</tr>
<%
}%>
<% if (QueryString=null){
      out.print("nothing is passed");
        }
    else
    {
      out.print("Something is passed");
    }
%>
<%ibook_id = Integer.parseInt(request.getParameter("book_id"));%>
<%disB.setBook_id(ibook_id);%>
<%= disB.getBook_id()%>

</table>
</td></tr></table>
<br>
%>
</BODY>
</HTML>

pls solve this problem that will be great
Regards Preeti

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to