1. To develop a custom behavior, you need to use a series of classes and interfaces, which are called the tag extension mechanism in JSP1.1 specifications ). All interfaces and classes required to implement the tag Handler are defined in the javax. servlet. jsp. tagext package. The two main interfaces are Tag and BodyTag. To make the development of the tag handler easier, the API defines two supported classes: TagSupport and BodyTagSupport. These two classes provide the default implementation fo
2015-09-23 Jstl label (ii) One: FMT Label:formatdateTo use the FMT tag in a JSP page:The 1GT;FMT tag library is used toLattice-type output ofThe label for the formatted date is:Where value specifies a variable of date type; pattern is used to specify the date template for the output, for example: yyyy-mm-dd hh:mm:ssTag Value: Specifies a variable or constant of a numeric type; pattern: Specifies the type of the number that is formatted, and also rounds for example: 0.00,#.## use 0 and # are diff
var.Traverse Map----------------------Loop stateYou can use Varstatus to create loop state variables!The loop state variable has the following properties:*count: Number of looping elements*index: The subscript of a looping element*first: is the first element*last: is the last element*current: Current ElementResults0 1 true false one1 2 false false two2 3 false True Three====================================FMT LibraryIt is a format libraryValue: Specifies a variable of type datePattern: The temp
of implementing the SimpleTagSupport class (similar to implementing the SimpleTag interface.
First, you need to prepare a SimpleTag. tld file for registering custom tags. This file is in the apache-tomcat file, and the general address is inE: \ apache-tomcat-6.0.39 \ webapps \ examples \ WEB-INF \ jspThe name isJsp2-example-taglib.tld.
Use a jsp page that shows the current time as the first example:
Create a custom tag:
1) create a tag processing
because there is no JSP expression. Creating a tag library Descriptor (TLD) file JSP tag Library requires a tag library Descriptor (TLD) file to customize tag naming, their attributes, and Java classes that operate on the tag. Jspcache. tld describes two custom tags,
There are two attributes: the id of the cached page fragment and the range of content to be
1. To develop a custom behavior, you need to use a series of classes and interfaces called tag extension mechanisms in JSP1.1 specifications ). All interfaces and classes required to implement the tag Handler are defined in the javax. servlet. jsp. tagext package. The two main interfaces are Tag and BodyTag. To make the development of the tag handler easier, the API defines two supported classes: TagSupport and BodyTagSupport. These two classes provide the default implementation for the above tw
not talk about the specific reason for this operation and the principle. You can refer to the following article: details on Drag and Drop upload on Renren homepage (HTML5 Drag Drop, FileReader API, and formdata). However, the code for uploading ajax files is still a bit different, because Renren seems a little troublesome, I will find another way.The last step is to upload some PHP code. Here I just provide a reference. You can compile it as needed.The Code is as follows:$ R = new stdClass ();
HTTP Error code, for example: 404
exception
JAVA exception type with the full name
/path
related resource paths on the
Web platform
/error-page>
example:
404
/error404.jsp
JAVA. lang. exception
/condition T. JSP
_______________________________________________The JSP-
common JSP purposes, and you can also execute tag handler to extend the class support. Follow these steps.
First, execute a label manager class:
packagecom.myactions;
(importstatementsgohere)
publicclassMyActionTagextendsTagSupport{
...
}
Next, compile the code and place the class file in the class library of the program. Then, you will need a Tag Library Descriptor (TLD) file, which is an XML file to match your operation
remove pages from jsp script elements
B) make java code appear as few pages as possible
C) Advantage: it can be used with EL expressions to replace attribute values for further dynamic changes.
3) Use
A) import the tag Library (this step is required in Eclipse and other tools)
B) Steps for using tags in the tag Library
I. Add JSTL JAR files: jstl. jar and standard. jar to the WEB-INF/lib directory of the application (see the courseware directory "JSTL label library" for the jar files ")
Ii. Spe
, FileReader API, and formdata). However, the code for uploading ajax files is still a bit different, because Renren seems a little troublesome, I will find another way.
The last step is to upload some PHP code. Here I just provide a reference. You can compile it as needed.
$ R = new stdClass (); header ('content-type: application/json'); $ maxsize = 10; // Mbif ($ _ FILES ['xfile'] ['SIZE']> ($ maxsize * 1048576 )) {$ r-> error = "the image size cannot exceed $ maxsize MB" ;}$ folder = 'files/'
respectively.
You can create a tag library for common JSP purposes, and you can also execute tag handler to extend the class support. Follow these steps.
First, execute a label manager class:
Packagecom. myactions;
(Import statements go here)
Public class myactiontag extends tagsupport {...}
Next, compile the code and place the class file in the class library of the program. Then, you will need a tag library Descriptor (TLD) file, which i
learned before, the random forest fern of TLD records the number of positive and negative samples to calculate posterior. This method is better than long time tracking, and TLD performs well in every detail, its update model also has the theoretical support of dynamic systems. These are my personal opinions and I hope to have more communication. -- Old bear
5. If you add trick to some tracking algorithms,
This article from http://blog.csdn.net/carson2005/article/details/7647519
I have translated an article on PN learning before: NLP. Pn learning is an important module, especially in TLD tracking algorithms. If you cannot fully understand this part, it is difficult to fully master the essence of the TLD algorithm. Therefore, based on the previous translation, I will introduce the principle of PN learning base
the Setpagecontext method of the tag interface to initialize the PageContext variable before calling the doStartTag method. The tag interface will be described in section 1.1.3, where it is necessary to implement the tag interface as long as all the tag classes are known. To simplify the implementation of the Label class, the JSP API provides a TagSupport class, with the TagSupport class, where the user does not need to implement all the methods of the tag interface when writing the tag class.3
value of this tag/NBSP;NBSP;NBSP;NBSP;NB sp; out.print ("Hello JSp2.0 tag"); } Then build the TLD file. As shown in the figure Select Taglib Descriptor Next we can select where to generate the TLD file, and the name, where I have not changed its default value. Click Next > Until we can select the tag body content for empty. Finish. You can see the JSP Tag Wizards v3.0 generates MYTAG2.
Bodytag interface, which are executed by the TagSupport class and the Bodytagsupport class respectively.
You can build a tag library for general-purpose JSP purposes, and you can also perform tag manager (tag handler) to extend the support of classes. Here are the steps to implement these procedures.
First, the class that executes a tag manager:
Packagecom.myactions;(Import statements Go)public class Myactiontag extends TagSupport {...}
Next, compile the code and place the class file in the pro
Composite pages, is always a development of the Web application must face the problem, the struts of the titles have tired, heard Sitemesh good, try, originally thought complex, who knows to use it is so simple, too amazing.Write down the trial tutorial:1. Prepare a Web project to download the Sitemesh package and TLD files to the Sitemesh official websiteHttp://wiki.sitemesh.org/wiki/display/sitemesh/Home2. Add the Sitemesh-2.3.jar to the classpath a
process for JSP tags
When you use Java processing classes to develop custom JSP tags, you are primarily divided into the next few steps.
– create a processing class for the label (tag Handle Class). This class implements the tag interface to define the behavior of the label and invoke execution when the JSP engine encounters a custom label.
– Create a tag library description (TLD) file (Tag Library descriptor file) that describes the label processor
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.