Đang chuẩn bị liên kết để tải về tài liệu:
Java Server Pages: A Code-Intensive Premium Reference- P7

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Java Server Pages: A Code-Intensive Premium Reference- P7: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. | BODY HTML Note A key thing to note is the HTML code that is intermingled throughout the scriptlet code. This is done by closing the scriptlet block with the symbol inserting the HTML code and then reopening the scriptlet block with the symbol. As you look through the generated listing examine how this is implemented in the _jspService method. There is really nothing special about the JSP presented in Listing 4.5. You are simply taking a basic JDBC query and embedding into a JSP scriptlet. When this JSP is first requested it is compiled into a servlet and the scriptlet code containing the query is placed into the generated _jspService method. A code snippet follows containing the generated method with small changes for readability 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 jspxFactory JspFactory.getDefaultFactory response.setContentType text html pageContext _jspxFactory.getPageContext this request response true 8192 true application pageContext.getServletContext - 61 - config pageContext.getServletConfig session pageContext.getSession out pageContext.getOut begin out.write HTML r n HEAD r n TITLE JSP JDBC Example 1 TITLE r n HEAD r n r n BODY r n r n -- Set the scripting language to java and -- r n -- import the java.sql package -- r n end begin out.write r n r n end begin file D JDBCExample.jsp from 11 2 to 33 6 Connection con null try Load the Driver class file Class.forName sun.jdbc.odbc.JdbcOdbcDriver Make a connection to the ODBC datasource con DriverManager.getConnection jdbc odbc Movie Catalog Create the statement Statement statement con.createStatement Use the created statement to SELECT the DATA FROM the Titles Table. ResultSet rs .

Đã 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.