Introduction to the commonly used flag of Struts 2.0 (TAG)

Source: Internet
Author: User
Tags expression

In the previous article "Preparing for Struts 2.0", I described in detail the configuration of the Struts 2.0 development environment and the running environment, so the two details are rarely covered in this article. If, after you read "Ready for Struts 2.0", what still do not understand, or can not run the example in this article, please contact me. My e-mail:max.m.yuan@gmail.com.

Before introducing the common logo, I would like to make a general comparison between Struts 1.x and Struts 2.0 's logo library (Tag libraries).

Struts 1.x Struts 2.0
Classification Divide the logo library by functionality into HTML, Tiles, logic, and bean parts Strictly speaking, there is no classification, all flags are under the URI "/struts-tags" namespace, but we can divide it into two categories from the functional: non-UI flags and UI flags
Expression language (expression languages) Embed language not supported (EL) OGNL, JSTL, groovy and velcity

The above form is a personal summary, if there are some deficiencies or mistakes, please do not hesitate to correct me

Well, I'm going to start by introducing the "common" (here is the so-called "common", refers to the use of struts in the past work often used) logo.

To use the Struts 2.0 flag in a JSP, first indicate the introduction of the flag. This can be done by adding the following code at the top of the JSP's code.

<% @taglib prefix= "s" uri= "/struts-tags"%>

Non-UI flags if, ElseIf, and Else

Describe:

Perform basic conditional flow.

Parameters:

name required default type description note
  boolean ELSE flag does not have this parameter
id &NBSP; object/string &NBSP;

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.