Javascript+struts2 Sample Summary

Source: Internet
Author: User

    • If

<struts:if test= '%{testbean.test} ' > is </struts:if>
<struts:else> No </struts:else>

Other wording:

Equals

<s:if test="User.username eq \" a\ "">

<s:if test="user.username==\" a\ "">

<s:if test=' user.username eq "a" '>

Less than

<s:if test="user.age lt 0"> less than 0</s:if>

Or

<s:if test="Null==list2 or 0==list2.size"> is empty </s:if>

    • Iterator

<struts:iterator value= "Testlst" >
<div>
<struts:property value= "Test"/>
</div>
</struts:iterator>

    • Select+iterator+enum

<select id= "XX" >
<struts:iterator value= "Types" >
<option value= "<struts:property value=" key "/>" ><struts:property value= "value"/></option>
</struts:iterator>
</select>

    • Select Check Value

$ ("#selectid option:selected"). Val ()

$ ("#selectid option:selected"). Text ()

$ ("#selectid"). Val ("Pxx")

$ ("#selectid"). Find ("option[text= ' xx ']"). attr ("selected", true)

$ ("#selectid"). Val ()

$ ("#selectid"). Find ("option:selected"). Text ();

Javascript+struts2 Sample Summary

Related Article

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.