Hi guys,

well i m currently developing this registration form with a backend 
processing file that will handle the procedures of updating datas that are 
typed in the registration page. But the thing is whenever there's a item in 
the registration page not filled in, tomcat "famous" error 500 will be 
displayed telling the user that some items are not filled in or data 
mismatch. what i was thinking was can i have a customed made error page 
called error.jsp to handle all these errors instead of letting the user see 
this error 500 page, he will see a nice error page asking him to do whenever 
necessary. Thanks for any suggestions on how i can go about doing this error 
page.
Attached are the two files..the registration page is CarltonReg.jsp
and the processing page is CarltonAddC.jsp.

thanks again
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Title: RegistrationPage
<%@ page language="java" import="java.sql.*" %>





<% stmt.close(); myConn.close(); %>
Online Reservation Form

  Reservation Information 

Guest Name :

<% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection myConn = DriverManager.getConnection("jdbc:odbc:Clientdb1"); Statement stmt = myConn.createStatement(); ResultSet myResultSet = stmt.executeQuery("select * from title"); if (myResultSet != null) { while (myResultSet.next()) { String dpid = myResultSet.getString("stid"); String dpname = myResultSet.getString("name"); %> '><%= dpname %> <% } /* of while */ } /* of if */ %>

Email Address :

**IMPORTANT**
Address :
(optional)

Telephone No :
Fax No :
  

  Reservation Details

Types of Rooms Required : <% myResultSet = stmt.executeQuery("select * from Carlton_RoomType"); if (myResultSet != null) { while (myResultSet.next()) { String typeid = myResultSet.getString("Room_TypeId"); String typenum = myResultSet.getString("Room_Type"); %> '><%= typenum %> <% } /* of while */ } /* of if */ %> **IMPORTANT**
Number of Rooms Required :
  Please also furnish names of the guests for the additional rooms
 (Please put NA if it is not avaliable.)
 
Date of check in : <% myResultSet = stmt.executeQuery("select * from Day"); if (myResultSet != null) { while (myResultSet.next()) { String dayid = myResultSet.getString("Dayid"); String daynum = myResultSet.getString("DayNum"); %> '><%= daynum %> <% } /* of while */ } /* of if */ %> <% myResultSet = stmt.executeQuery("select * from Month"); if (myResultSet != null) { while (myResultSet.next()) { String monthid = myResultSet.getString("Monthid"); String monthnum = myResultSet.getString("Month"); %> '><%= monthnum %> <% } /* of while */ } /* of if */ %> <% myResultSet = stmt.executeQuery("select * from Year"); if (myResultSet != null) { while (myResultSet.next()) { String yearid = myResultSet.getString("Yearid"); String yearnum = myResultSet.getString("Year"); %> '><%= yearnum %> <% } /* of while */ } /* of if */ %> **IMPORTANT**
Days of Stay : <% myResultSet = stmt.executeQuery("select * from Duration"); if (myResultSet != null) { while (myResultSet.next()) { String dayid = myResultSet.getString("Durationid"); String daynum = myResultSet.getString("Number_of_days"); %> '><%= daynum %> <% } /* of while */ } /* of if */ %>
  

  Flight Information

Flight name and no. (Arrival) : Time of Arrival : **IMPORTANT**

Indicate here for any special request eg: connecting rooms, no smoking, etc. (Please put NA if it is not avaliable.)            
  

  

  Credit Card Information **IMPORTANT**

Credit Card Number :
Credit Card Expiry Date : <% myResultSet = stmt.executeQuery("select * from Month"); if (myResultSet != null) { while (myResultSet.next()) { String monthid = myResultSet.getString("Monthid"); String monthnum = myResultSet.getString("Month"); %> '><%= monthnum %> <% } /* of while */ } /* of if */ %> <% myResultSet = stmt.executeQuery("select * from Year_Exp"); if (myResultSet != null) { while (myResultSet.next()) { String yearid = myResultSet.getString("Yearid"); String yearnum = myResultSet.getString("Year"); %> '><%= yearnum %> <% } /* of while */ } /* of if */ %>
Type of Credit Card : <% myResultSet = stmt.executeQuery("select * from CreditC"); if (myResultSet != null) { while (myResultSet.next()) { String cardid = myResultSet.getString("CreditCid"); String cardtype = myResultSet.getString("Cards_Type"); %> '><%= cardtype %> <% } /* of while */ } /* of if */ %>

Noted that Credit Card Guarantee Required for all late check-in after 5pm, weekends and holidays. No transaction will be carried out, credit card merely to guarantee reservation unless there is a event of no-show or late cancellation (two days prior to check-in date) where 1 night room rate will be imposed. Please furnish valid credit card details after you have clicked send.

If you encounter any difficulties sending your booking details through this form, you may send your booking details to our reservation center at Online Hotel Booking


Title: Hotel Registration Processing
<%@ page language="java" import="java.sql.*" %>





Processing Request

Thank you, your request is submitted. Please check your E-Mail for the results half an hour from now.
<% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection myConn = DriverManager.getConnection("jdbc:odbc:Clientdb1"); String ititle = request.getParameter("inptitle"); String iname = request.getParameter("inpname"); String iemail = request.getParameter("inpemail"); String iadd = request.getParameter("inpadd"); String itel = request.getParameter("inptel"); String ifax = request.getParameter("inpfax"); String itype = request.getParameter("inptype"); String inum = request.getParameter("inpnum"); String iguest = request.getParameter("inpguest"); String idayin = request.getParameter("inpdayin"); String imonthin = request.getParameter("inpmonthin"); String iyearin = request.getParameter("inpyearin"); String iduration = request.getParameter("inpduration"); String iflightin = request.getParameter("inpflightin"); String itimein = request.getParameter("inptimein"); String ireq = request.getParameter("inpreq"); String icardnum = request.getParameter("inpcardnum"); String imonthexp = request.getParameter("inpmonthexp"); String iyearexp = request.getParameter("inpyearexp"); String icardtype = request.getParameter("inpcardtype"); Statement stmt = myConn.createStatement(); int rowsAffected = stmt.executeUpdate("insert into Carlton_Hotel(Title,Name,Email,Address,TelNum,FaxNum,Room_Type,Num_of_Room,Guest,DayIn,MonthIn,YearIn,Duration,FlightIn,TimeIn,Request,Credit_Card_Number,Expiry_Month,Expiry_Year,Card_Type) values('" + ititle +"','" + iname +"','" + iemail + "','" + iadd + "','" + itel + "','" + ifax + "','" + itype + "','" + inum + "','" + iguest + "','" + idayin + "','" + imonthin + "','" + iyearin + "','" + iduration + "','" + iflightin + "','" + itimein + "','" + ireq + "','" + icardnum + "','" + imonthexp + "','" + iyearexp + "','" + icardtype + "')"); if (rowsAffected == 1) { %> <% } else { %> Sorry Update fails! <% } stmt.close(); myConn.close(); %>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to