For versions earlier than javaEE5, You need to reference JSTL-related jar packages and tld files. After JAEE5, you don't have to worry about this. If you still cannot use it, download it from the official website (jstl. jar and standard. jar) The two jar packages put the corresponding tld file under the root directory of the project. The core tag library is the core tag library of JSTL, or the basic tag library, the most basic functions are implemented. The following is an example: 1. When the <c: out/> label shows out, you should be able to guess what the output means. In this case, the out tag is used to output data, the following is a simple example.
<Span style = "font-family: SimSun; font-size: 14px;"> the action parameter is: <c: out value = "$ {param. action} "> </out> </span>
Isn't it easy? First, let me explain: out is the Tag Name and value is its attribute. Do some new users not know $ {param. action? This is an EL expression. If you are interested, I will explain it separately later. The actual effect of this expression is the same as that of request. getParameter ("action. In fact, the out Tag also has the default and escapeXml attributes, Where default is the default value, if the default value is output without the value attribute, if excapeXml is true (excapeXml is true by default ), the output content will be encoded in xml format (note that only special characters such as "&", "<", and ">" will be encoded). Is it a bit dizzy for some students? For example, <c: out value = '$ {"<>"}'/> do you know what the output is? Yes & lt, & gt, and $ {"<>"} directly outputs <>. This is a magic thing. It seems useless. You can knock on the code on your computer. 2. The <c: if/> label is the condition judgment label in JSTL, it is equivalent to the if condition judgment in java <c: if test = "{param. action = 'ceshi'} "> your content </c: if> when param. if the value obtained from the action is ceshi, it is true. Therefore, the content in the result will be output. Note: <c: if test = "{1 = 1}"> the condition is false </c: if> <c: if test = "$ {1 = 1}"> the condition is true </c: if>. For this reason, you can find out why? If else exists in java, is there a <c: else> label? The answer is no. What should I do if I want to implement this function? Solution: <c: choose/>, <c: when/>, and <c: othsewise> help you solve the problem. Usage: <c: choose> <c: when test = "$ {param. action = 'ceshi'} "> when TAG output </c: when> <c: otherwise> otherwise output </c: otherwise> </c: choose> is it really tough? If you are interested, please wait for further explanation.