tailieunhanh - Dreamweaver MX 2004 phần 8

Bạn cũng có thể tương tác với người dùng của bạn bằng cách tạo ra một blog nơi họ có thể đọc các thông tin đăng của bạn về tin tức liên quan đến các trang web hoặc các chủ đề quan tâm khác. Mặc dù Dreamweaver không trực tiếp hỗ trợ các loại tures Fea xây dựng cộng đồng, bạn chắc chắn có thể thêm các tính năng này | 474 chapter 23 Working with JSP 5. Specify the location of the JDBC-ODBC driver. Select Using Driver On This Machine for a local web server or Using Driver On Testing Server for a remote web server . 6. Enter a user name and password if necessary to access the database. 7. Click Test. An alert box displays to let you know if the connection was successful. For more information on using databases in Dreamweaver see Chapter 19 Database Connectivity. Creating a Dynamic JSP Page Now let s create a simple JSP page to show the current date and time and test it in our web server. This page accesses the current date and time on the server that processes the JSP page. If you re using a local web server it will display the local values for time and date. If you re using a remote web server it will display the time and date for the server location. 1. Open a new JSP file in Dreamweaver File New Dynamic Page JSP . 2. Save the file as . 3. Open the Design panel group and click on the Options menu in the upper-right corner. Select Attach Style Sheet. From the Attach External Style Sheet window click on the Sample Style Sheets link at the bottom. Choose the Colors Yellow Brown style sheet it s included in the Chapter 23 folder on the CD as . 4. Add the following HTML text to highlight the time Today is 5. Leave a space then add the following code to request the current time from the server and write it to the page new Figure Using the JSP Server to display the current date and time. Note the and tags which indicate that this is a JSP script block. 6. Save the page. 7. Preview the page in a browser File Preview In Browser . It should resemble Figure . using JSP in DREAMWEAVER 475 Using JSP in Dreamweaver Now that a database connection is established you re ready to use JSP and Dreamweaver MX 2004 to access the TrioMotors database and build a search and result page. You ll build a search page using an HTML form. You ll use a single .