
|
編程(Programming)是編定程序的中文簡稱,就是讓計(jì)算機(jī)代碼解決某個(gè)問題,對某個(gè)計(jì)算體系規(guī)定一定的運(yùn)算方式,使計(jì)算體系按照該計(jì)算方式運(yùn)行,并最終得到相應(yīng)結(jié)果的過程。為了使計(jì)算機(jī)能夠理解(understand)人的意圖,人類就必須將需解決的問題的思路、方法和手段通過計(jì)算機(jī)能夠理解的形式告訴計(jì)算機(jī),使得計(jì)算機(jī)能夠根據(jù)人的指令一步一步去工作,完成某種特定的任務(wù)。這種人和計(jì)算體系之間交流的過程就是編程。 對于代碼方面的知識,小編在前面也給大家有過這方面的介紹,今天接著來給大家講解Struts2標(biāo)簽是什么意思。小編在這里給大家總結(jié)了兩個(gè)方面,希望對大家有所幫助。 struts2標(biāo)簽總體來說分為兩大類:UI標(biāo)志和非UI標(biāo)志,下面看看struts2標(biāo)簽的具體內(nèi)容: 1、UI標(biāo)志 其中在UI標(biāo)簽中又可以分為表單UI和非表單UI,表單UI基本上和Struts1.x標(biāo)簽相同,都是對HTML的表單元素進(jìn)行包裝。但是對于Struts2來說,我們經(jīng)常會在一些項(xiàng)目中用到:datepicker、doubleselect、timepicker、 optiontransferselect等。下面我們一起來看看具體UI的用法,相信大家就會明白了。 form:
<s:form action="exampleSubmit" method="post" enctype="multipart/form-data">
<s:submit />
<s:reset />
</s:form>可以上傳文件的form。
textfield:
<s:textfield
label="姓名:"
name="name"
tooltip="Enter your Name here" />
datepicker:
<s:datepicker
tooltip="Select Your Birthday"
label="生日"
name="birthday" />
textarea:
<s:textarea
tooltip="Enter your remart"
label="備注"
name="remart"
cols="20"
rows="3"/>
select:
<s:select
tooltip="Choose user_type"
label=""
list="#{'free':'免費(fèi)','vip':'收費(fèi)'}" value="#{'free':'免費(fèi)'}"
name="bean.user_type"
emptyOption="true"
headerKey="None"
headerValue="None"/>
<s:select
tooltip="Choose user_type"
label=""
list="#{'free':'免費(fèi)','vip':'收費(fèi)'}" value="#{'free':'免費(fèi)'}"
name="bean.user_type"
emptyOption="true"
headerKey="None"
headerValue="None"/>
<s:select
list="venderList"
listKey="id"
listValue="name"
value="%{profile.companyName}"
name="companyName" cssClass="sel_style_w_180"/>
挺好用的
checkboxlist:
<s:checkboxlist
tooltip="Choose your Friends"
label="朋友"
list="{'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}"
name="friends"/>
checkbox:
<s:checkbox
tooltip="Confirmed that your are Over 18"
label="年齡"
name="legalAge"
value="18"/>
file:
<s:file
tooltip="Upload Your Picture"
label="Picture"
name="picture" />
a:
<s:a href="getP.jsp">超鏈接提交</s:a>
date :
<s:date name="ad_end_time" format="yyyy-MM-dd"/> 2、非UI標(biāo)志 非UI標(biāo)志對if、elseif和else的描述:執(zhí)行基本的條件流轉(zhuǎn)。 <%@ page c %> <%@ taglib prefix="s" uri="/struts-tags" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Condition Flow</title> </head> <body> <h3>Condition Flow</h3> <s:iterator value="linkList" status="bean"> <tr> <td class="data_tab_tdcl"> <s:property value="#bean.Index+1" /></td> <td class="data_tab_tdcl"><s:property value="link_title" /></td> <td class="data_tab_tdcl"><s:property value="link_url" /></td> <td class="data_tab_tdcl"> <s:if test="link_type == 1"> 文字 </s:if> <s:elseif test="link_type == 2"> 圖片 </s:elseif> <s:else> ----- </s:else> </td> </body> </html> 以上就是關(guān)于Struts2 標(biāo)簽的全部內(nèi)容,希望對大家有所幫助,更多詳細(xì)資料請繼續(xù)瀏覽本站。 使用編程語言寫的程序,由于每條指令都對應(yīng)計(jì)算機(jī)一個(gè)特定的基本動作,所以程序占用內(nèi)存少、執(zhí)行效率高。 |
溫馨提示:喜歡本站的話,請收藏一下本站!