TAILIEUCHUNG - Java Server Pages: A Code-Intensive Premium Reference- P8

Java Server Pages: A Code-Intensive Premium Reference- P8:Before you begin reading Pure JSP Java Server Pages, you might want to take a look at its basic structure. This should help you outline your reading plan if you choose not to read the text from cover to cover. This introduction gives you an overview of what each chapter covers. | throw new Exception A Pure JSP Exception You will notice in this listing that the first line of code sets the errorPage equal to which is the name of our error page. The rest of our example is just used to throw an exception that will not be caught. That is all there is to it. Just copy both of these JSPs to the SERVER_ROOT purejsp directory and open the test-error. j sp page in your browser. You will see a page similar to Figure . Figure Output of the example. To see how this error is handled in the actual compiled code let s take a look at the _jspService method generated from the example. The following code snippet contains the generated jspService method public void _jspService HttpServletRequest request HttpServletResponse response throws lOException ServletException JspFactory _jspxFactory null PageContext pageContext null HttpSession session null ServletContext application null ServletConfig config null JspWriter out null Object page this String _value null try if _jspx_inited false _jspx_init _jspx_inited true - 71 - _jspxFactory text html pageContext this request response true 8192 true application config session out begin r n r n end begin file D from 2 2 to 10 0 if true Just throw an exception throw new Exception A Pure JSP Exception end begin r n end catch Exception ex if 0 ex finally pageContext The first section of code you need to look at is the call to get the PageContext object from the JspFactory using the getPageContext method. This method obtains an instance of an implementation dependent abstract class for the calling servlet - 72 - and .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.