TAILIEUCHUNG - Java 2 Bible Enterprise Edition phần 2

Chương 4: Sử dụng JavaServer Pages sử dụng để có được nhiều chức năng hơn với mã Java trong các trang JSP của họ. Bạn có thể tạo ra các thư viện thẻ của bạn ngoài việc sử dụng những cái mà được công bố. Một thư viện mã nguồn mở thẻ có thể được tìm thấy tại . | Chapter 4 Using JavaServer Pages use to get more functionality with less Java code in their JSP pages. You can create your own tag libraries in addition to using the ones that are publicly available. An open-source tag library can be found at http taglibs. You can also find links to various JSP tag libraries at http and at http products jsp . The process of developing and using a tag library has three basic parts. First the programmer creates and compiles a Java class that often extends either the TagSupport class or the BodyTagSupport class in the package . This class specifies what is done at the beginning and end of the tag with the doStartTag and doEndTag methods. Second the programmer places an entry called a tag library descriptor file TLD in an XML file. The entry includes the name that will be used to refer to this tag the Java class that it refers to and other information used to specify the format of the tag. Third the Web designer writes the JSP page that uses this tag. He or she first has to use the taglib directive to point to the TLD created in the second step. He or she then follows the usage rules specified in the TLD to actually use the tag. We ll walk you through these steps as you create several examples of using custom tags. First you ll create an empty tag that returns the date. Then you ll create a tag that changes the formatting of the code that comes before the opening and closing tag which you ll see can include what is returned by another tag. You ll also see bean-like behavior as you pass the value of attributes to the class associated with the custom tag. A class that returns the current time Let s return to the example of displaying the current time at the server. Create a simple class with the following code package ourtags import . import . import . import . public class CurrentTime extends .

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.