Struts Layout下载地址:
[url]http://struts.application-servers.com/index.html[/url]
一.配置:
[url]http://struts.application-servers.com/install.html[/url]有详细的说明
1.把下面的两端加入到struts-config.xml中:
一.配置:
[url]http://struts.application-servers.com/install.html[/url]有详细的说明
1.把下面的两端加入到struts-config.xml中:
<
action
path
="/sort"
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文件中加入:
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
2.复制struts-layout.jar到WEB-INF/lib目录下
3.在web.xml文件中加入:
<jsp-config>
<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>
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
4.把struts-layout.tld复制到WEB-INF目录下
5.把resources文件下的config文件拷贝到webroot目录下,并把p_w_picpaths目录下的所有文件拷贝到config目录下。
二.实例运行:
写个一般的jsp,当然对应的Action,ActionForm已经写好了。
<
layout:html
>
<
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>
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![None.gif](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/e68675414ab2bcf11311719472646040.jpeg)
转载于:https://blog.51cto.com/442277/89420