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.