一.配置:
[url]http://struts.application-servers.com/install.html[/url]有详细的说明
1.把下面的两端加入到struts-config.xml中:
type="fr.improve.struts.taglib.layout.sort.SortAction"
scope="request"
validate="false">
< SPAN>action>
<action path="/treeview"
type="fr.improve.struts.taglib.layout.treeview.TreeviewAction"
scope="request"
validate="false">
< SPAN>action>
2.复制struts-layout.jar到WEB-INF/lib目录下
3.在web.xml文件中加入:
<taglib>
<taglib-uri>[url]http://struts.application-servers.com/layout[/url]< SPAN>taglib-uri>
<taglib-location>/WEB-INF/struts-layout.tld< SPAN>taglib-location>
< SPAN>taglib>
< SPAN>jsp-config>
4.把struts-layout.tld复制到WEB-INF目录下
5.把resources文件下的config文件拷贝到webroot目录下,并把p_w_picpaths目录下的所有文件拷贝到config目录下。
二.实例运行:
写个一般的jsp,当然对应的Action,ActionForm已经写好了。
<layout:form action="/layout" styleClass="FORM">
<layout:text key="search.name" property="name" styleClass="FIELD"/>
<layout:text key="search.town" property="town" styleClass="FIELD"/>
<layout:date key="serach.date" property="date" styleClass="LABEL"/>
<layout:submit>
<layout:message key="search.submit"/>
< SPAN>layout:submit>
< SPAN>layout:form>
< SPAN>layout:html>