Logic: equal, logic: present usage

Source: Internet
Author: User

Logic: equal, logic: present usage

1.

<Logic: equal value = "A" name = "documentcontent"> display </logic: equal>

 

<Logic: equal name = "deliverproveform" property = "useraction" value = "CREATE">

If the value of the attribute useraction in deliverproveform is equal to create, execute this operation.

</Logic: equal>

2. <logic: present name = "tipmsg"> If tipmsg is set in your action, it will be executed here. For example, request. setattribute ("tipmsg", "prompt message") or session. setattribute ("tipmsg", "prompt message") <Bean: write name = "tipmsg"/> </logic: Present>

 

----------------------------------------------------------------------------

Use of label <logic: Present>

Request. getsession (). setattribute ("pagebean", pagebean );

Request. setattribute ("result", pagebean. getobjlist ());

 

In JSP:

<Logic: present name = "result">

<Logic: iterate id = "book" name = "result">

<Logic: present name = "book">

<Tr>

<TD> <Bean: write name = "book" property = "name"/> </TD>

<TD> <Bean: write name = "book" property = "author"/> </TD>

<TD> <Bean: write name = "book" property = "price"/> </TD>

</Tr>

</Logic: Present>

</Logic: iterate>

</Logic: Present>

<Logic: present name = "result" Scope = "session">

Here there is a scope attribute that may be request, session, etc. name refers to an object, which may be a JavaBean or a collection object. The whole meaning is in the scope (Session, query whether the name (an object) exists in the request range, which is equivalent to an IF () statement.

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.