Hi there..
Use one hidden variable called hdnBokID.
When you click on this link, call a java script function some thing like
following..
function fnnSubmit(var bookid)
{
    document.frm1.hdnBokID.value=bookid;
    document.frm1.action="sampage.jsp";
    document.frm1.submit();
}

that's it..You are done.
This will solve your problem..
Hope I understood your problem in a correct way..
------
with rgds,
M.V.Rao
Wipro Technologies
Survey No 64, Madhapur
Hyderabad - 500 033 , India.
Tel(w): +91-40-656 5334(direct), Board +91-40-656 5000
Tel(h): +91-40-657 7762
E-mail:[EMAIL PROTECTED]
Corporate Web Site : www.wipro.com
The World's First SEI CMM Level 5 Software Services Company


> > 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