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 .