The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by shinwari]

sir i jsp beginner.i want to build a shopping cart and i am working on it.i
have two files one is static book.html which just show book title author and
price.if i make a hyper link of book name and some one click on it, than
request will go to the book.jsp file to process the request.
My question is that how i shall get a book name from hyper link on the jsp
file.according to which i display record from database thanks.
import-bot (20211) [Avatar] Offline
#2
Re: shopping cart
[Originally posted by shariqzeeshan]

Hi Naveed,

It could be done 2 ways,

1. You can pass the name of the book alongwith the bookID in the URL. so you
can acess the bookName on the next page just by accessing the REQUEST scope
varialbes.

2. Or you just pass the bookID and on the next page (say book.jsp) pick the
book name by using a query (SELECT statement of SQL like "select * from book
where bookID = ....."). Then you can have the bookName available to be used on
the jsp page.

I think as you are using the HTML page for dsiaplaying the book ( and NOT from
a database table) so better use tecnique # 1.

Hope this helps.
Shariq Zeeshan

> sir i jsp beginner.i want to build a shopping cart and i am working on it.i
> have two files one is static book.html which just show book title author and
> price.if i make a hyper link of book name and some one click on it, than
> request will go to the book.jsp file to process the request.
> My question is that how i shall get a book name from hyper link on the jsp
> file.according to which i display record from database thanks.