tailieunhanh - Dynamic Web Pages using JSP - Lab Deliverable 5

JSP ứng dụng Mô hình 1. Viết một chương trình bao gồm một tập tin HTML trong một trang JSP sử dụng phương pháp giao diện RequestDispatcher. Các tập tin bao gồm sẽ hiển thị một hình thức đăng nhập để người sử dụng. Ngoài ra, hình thức cung cấp một nút Submit và Thiết lập lại. Hiển thị tin nhắn Chào mừng bạn đến với người sử dụng khi người dùng nhấp chuột vào nút Submit sau khi nhập các chi tiết. . | Lab Deliverable 5 JSP Application Models Part II 1. Write a program to include an HTML file in a JSP page using RequestDispatcher interface method. The included file should display a login form to the user. In addition the form should provide a Submit and Reset button. Display a Welcome message to the user when the user clicks on Submit button after entering the details. Solution The files used to run the application are 1. Include. jsp 2. 3. DOCTYPE HTML PUBLIC - W3C DTD HTML Transitional EN html head title Include Example title link rel STYLESHEET href type text css head body bgcolor FDF5E6 text 000000 link 0000EE vlink 551A8B alink FF0000 P jsp include page flush true body html html head style body input font-family Tahoma font-size 10pt style head body -- HTML Form -- form action method post nbsp nbsp nbsp nbsp nbsp nbsp Enter your Account Id input type text name Acc_Id nbsp nbsp nbsp nbsp JSP Application Models Ver 2005 Aptech Limited 1 nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp Enter your Pin number input type text name Pin num br br br br Center input type submit value Submit Center form body html sp @ page language java import . html head title Welcome to our Website title head body center Welcome to Online Banking center body html The output of the program is as shown in Figure . Figure Output of When the user enters the details and clicks on Submit button the output appears as shown in Figure . 2 Ver 2005 Aptech Limited JSP and Struts Figure Output after clicking Submit button 2. Write a program to display an error message to the user if an exception occurs in the JSP page. In the JSP page consider a null string and find out the length of the string using length method of Java. Create an error handler to handle the exception thrown by this JSP page. Solution The files used to run the application are 1. .

TỪ KHÓA LIÊN QUAN