Struts Layout

<script type="text/javascript"> google_ad_client = "pub-8800625213955058"; /* 336x280, 创建于 07-11-21 */ google_ad_slot = "0989131976"; google_ad_width = 336; google_ad_height = 280; // </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> 正如软件有他的皮肤一样,我们的系统也有自己的皮肤,如果我们的应用系统可以让不同的客户选择自己喜欢的风格,那么我们将会感到无比的开心,难道不是吗? 可以更加容易的使用标记库,更轻松的开发出系统风格一致的系统 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可以更加容易的开发!
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值