tiles-struts
2008-01-05 18:44:53 来源:WEB开发网
引用:http://www.javaworld.com/javaworld/jw-01-2002/jw-0104-tilestrut.Html
ypically during Web application development, the user interface (UI) group creates the site's look and feel. Based on that look and feel, the group creates HTML pages that rePResent the application's functionality and navigation. With a servlets and JavaServer Pages (jsps)-based implementation, where HTML pages are converted into servlets and JSPs, UI developers identify common HTML and JSP view components, sUCh as header, footer, body, menu, and search. This article presents various solutions to effectively and efficiently organize HTML and JSP view components. I evaluate each solution using specific criteria, such as page number, code repetition, and layout control.
To eXPlore templating and layout solutions, we will use the Tiles framework. The Tiles framework's view components are known as tiles. The framework uses an xml configuration file to organize those tiles. This framework not only enables you to reuse tiles, but also the layouts that organize them.
To explore the more powerful and flexible solutions, we will investigate the synergy between the Tiles and Struts frameworks. Struts is an open source framework for developing Web applications using the popular Model-View-Controller (MVC) or Model 2 architectural pattern. Struts comes with a large set of reusable tags for which the Tiles tag library makes an Excellent enhancement.
Evaluation criteria
I will evaluate each solution based on the criteria below. The criteria are not mutually exclusive. For a specific situation and particular application, you must always balance between the strengths and weaknesses of each solution with respect to these factors.
Page number
A solution should strive to minimize the number of HTML and JSP pages. As the page number increases, the complexity of developing, managing, and maintaining an application increases drastically.
Code repetition
Under most circumstances, repetition is bad. The more repeated HTML and JSP code, the more difficult it is to develop and maintain an application. A simple change can result in a cascade of changes in many different pages with unpredictable consequences. A concrete and practical way of attaining reuse is to avoid code repetition.
Layout control
- ››Struts2配置文件中redirect传递中文参数乱码的解决...
- ››StrutsTestCase 简化开发过程
- ››struts 中一些包的详解
- ››struts1与struts2的区别
- ››struts学习1
- ››struts-2.1.8.1+jquery-1.3.2+spring-framework-2...
- ››Struts优缺点及实施经验总结
- ››Struts优缺点剖析
- ››Struts2中的DMI
- ››TileSense: AS3 tile based platform engine
- ››Struts2入门介绍1 -- Struts2介绍及运行一个简单...
- ››Struts2 redirectAction转向时默认加pass的问题
更多精彩
赞助商链接