DB Retrieving

I am develop a website for an airline by using JSP, MySQL, Netbean

- in the index.jsp , I create 2 field name=bookingID and name=lname to get the user inputs

- then, in the loginprocess.jsp, I user variable st1 to get bookingID, and variable st2 to get lname. NEXT, I compare the st1 and st1 to see whether it match the DB or not, if yes, user can see the bookingdetails.jsp

- Next, in the bookingdetails.jsp. I want to base on the bookingID that user give to display all the information that relavant to the bookingID. BUT, the bookingdetails.jsp page cannot understand the bookingID. so, I cannot select all the fields relavent to bookingID, please give me some helps, thanks so much. (^_^)

[717 byte] By [KonsaiWaltera] at [2007-11-27 9:21:45]
# 1

You say " the bookingdetails.jsp page cannot understand the bookingID ". I assume you mean the bookingID has no value when read from the bookingdetails.jsp page.

If this is so, you need to pass the value of bookingID from the loginprocess.jsp page to the bookingdetails.jsp page within the hyperlink. You append the infomration at the end of the hyperlink just after the '&' character.

Here is an example of how to do this:

On the loginprocess.jsp page (note no ';' at the end of getBookingID() ).

<a href"/loginprocess.jsp&bookingID=<%=x1.getBookingID()%>">

On the bolkingdetails.jsp page (note the ';' at the end of "bookingID")).

<%String bookingID= request.getParameter("bookingID");%>

George123a at 2007-7-12 22:15:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
thanks for your helps
KonsaiWaltera at 2007-7-12 22:15:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Some additional information you may find useful:

You can also store the bookingID on the first JSP page as a hidden textfield:<input type="hidden" value="<%=bookingID%>>

and read it on another page using

String bookingID= request.getParameter("bookingID");

Note: If you cant read the value using

String bookingID= request.getParameter("bookingID");

try

String bookingID= (String)request.getAttribute("bookingID");>

George123a at 2007-7-12 22:15:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...