国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

Struts Layout

2019-11-18 12:56:15
字體:
來源:轉載
供稿:網友

  正如軟件有他的皮膚一樣,我們的系統也有自己的皮膚,假如我們的應用系統可以讓不同的客戶選擇自己喜歡的風格,那么我們將會感到無比的開心,難道不是嗎?
  可以更加輕易的使用標記庫,更輕松的開發出系統風格一致的系統
  Struts基于mvc2的frameWork廣泛的應用的j2ee開發領域中,
  · configure struts for the webapp
  · configure the struts-layout treeview and sort action (just copy the corresponding lines of the struts-config file of the example application)
  · copy the struts-layout.jar file into the WEB-INF/lib Directory.
  · declare the struts-layout tld file in the web.xml file
  · copy the menu.jar file from the struts-layout example application into the WEB-INF/lib directory.
  · put a version of the common BeanUtils library in the WEB-INF/lib directory if using struts 1.0
  · copy the struts-layout.tld file into the WEB-INF directory.
  · copy the files in the config and images directory of the struts-layout example application in your new webapp.
  · if forward to Tiles definition will be used with sorting or paging on the server, the struts-layout request PRocessor
  
  example:
  ...
  <layout:form action="..." styleClass="FORM">
  <layout:grid cols="3">
  <layout:text key="Field 1" property="username1"/>
  <layout:text key="Field 2" property="username2"/>
  <layout:text key="Field 3" property="username3"/>
  <layout:text key="Field 4" property="username4"/>
  <layout:text key="Field 5" property="username5"/>
  <layout:text key="Field 6" property="username6"/>
  </layout:grid>
  <layout:grid cols="2">
  <layout:text key="Text input field 7" property="username7"/>
  <layout:text key="Text input field 8" property="username8"/>
  <layout:text key="Text input field 9" property="username9"/>
  <layout:text key="Text input field 10" property="username10"/>
  </layout:grid>
  </layout:form>
  ...
  
  ...
  <layout:form action="..." styleClass="FORM">
  <layout:row>
  <layout:collection name="users" styleClass="FORM">
  <layout:collectionItem title="users.login" property="login"/>
  <layout:collectionItem title="users.firstname" property="firstname"/>
  <layout:collectionItem title="users.lastname" property="lastname"/>
  <layout:collectionItem title="users.society" property="society"/>
  </layout:collection>
  <layout:column>
  <layout:text key="Field 1" property="username1"/>
  <layout:text key="Field 2" property="username2"/>
  <layout:text key="Field 3" property="username3"/>
  </layout:column>
  </layout:row>
  </layout:form>
  ...
  ...
  <layout:form action="..." styleClass="FORM">
  <layout:grid cols="2">
  <layout:collection name="users" styleClass="FORM" length="3">
  <layout:collectionItem title="users.login" property="login"/>
  <layout:collectionItem title="users.firstname" property="firstname"/>
  <layout:collectionItem title="users.lastname" property="lastname"/>
  <layout:collectionItem title="users.society" property="society"/>
  </layout:collection>
  <layout:column>
  <layout:text key="Field 1" property="username"/>
  <layout:text key="Field 2" property="username"/>
  <layout:text key="Field 3" property="username"/>
  </layout:column>
  </layout:grid>
  <layout:space/>
  <layout:grid cols="3">
  <layout:text key="Field 6" property="username"/>
  <layout:text key="Field 7" property="username"/>
  <layout:text key="Field 8" property="username"/>
  <layout:space/>
  <layout:text key="Field 9" property="username"/>
  <layout:space/>
  </layout:grid>
  </layout:form>
  ...
  
  
  jsp page:
  [
  
  <%@ page language="Java" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <%@ taglib uri="/WEB-INF/struts-Html.tld" prefix="html" %>
  
  <html:html locale="true">
  <head>
  <title><bean:message key="logon.title"/></title>
  <html:base/>
  </head>
  <body bgcolor="white">
  
  <html:errors/>
  
  <html:form action="/logon" focus="username">
  <table border="0" width="100%">
  
  <tr>
  <th align="right">
  <bean:message key="prompt.username"/>
  </th>
  <td align="left">
  <html:text property="username" size="16" maxlength="16"/>
  </td>
  </tr>
  
  <tr>
  <th align="right">
  <bean:message key="prompt.passWord"/>
  </th>
  <td align="left">
  <html:passWord property="password" size="16" maxlength="16"
  redisplay="false"/>
  </td>
  </tr>
  
  <tr>
  <td align="right">
  <html:submit property="submit" value="Submit"/>
  </td>
  <td align="left">
  <html:reset/>
  </td>
  </tr>
  
  </table>
  
  </html:form>
  
  </body>
  </html:html>
  
  ]
  
  layout page:
  [
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-layout.tld" prefix="layout" %>
  <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
  <layout:html locale="true" styleClass="FORM">
  <html:errors property="org.apache.struts.action.GLOBAL_ERROR"/>
  <layout:form action="/logon.do" focus="username" key="logon.title" styleClass="FORM">
  <layout:field key="prompt.username" property="username" size="16" maxlength="16" isRequired="true" styleClass="LABEL"/>
  <layout:field key="prompt.password" property="password" size="16" maxlength="16" type="password" styleClass="LABEL" isRequired="true"/>
  <layout:formActions>
  <layout:submit property="submit" value="Submit"/>
  <layout:reset/>
  </layout:formActions>
  </layout:form>
  </layout:html>
  
  
  ,使用layout可以更加輕易的開發!

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 金山区| 鹿邑县| 卓尼县| 楚雄市| 镇雄县| 墨竹工卡县| 屯门区| 镇康县| 晴隆县| 迁西县| 淮南市| 乐业县| 靖边县| 格尔木市| 万全县| 永泰县| 汽车| 西充县| 岳阳县| 大安市| 昌江| 西充县| 永登县| 泽州县| 巫溪县| 朝阳区| 绩溪县| 新泰市| 临夏县| 宝清县| 台中县| 砚山县| 封丘县| 长沙市| 从化市| 溧阳市| 高要市| 翁源县| 枞阳县| 镇远县| 青海省|