官术网_书友最值得收藏!

Chapter 5. Struts Tools

Struts Tools is a complex and complete solution for developing web applications using the Struts framework. Based on views, editors, and wizards, Struts Tools provides powerful support for developing and managing Struts configuration files, validator files, tiles files, and other Struts components. In this chapter we will see how to exploit these features of Struts Tools to develop a Struts application faster and easier than you have ever done before.

Speaking of Struts applications, in the following sections we will develop a classic Struts application that will take advantage of the most used Struts capabilities, such as Struts tags, validation, and tiles. The example consists of a simple JSP page containing a Struts form with three fields, as follows:

  • name—this is a text field that will allow the user to insert his name
  • zip—this is a text field that will allow to the user to provide a zip code
  • email—this is a text field for the user's email address

The information provided by the user will be client-side validated, submitted (using a Struts </html:submit> button), server-side validated, and displayed again in a new JSP page. As a particularity, both JSPs will have the same header and footer, which will be represented by a small and simple HTML code.

Tasks such as building the form, preserving information between pages, transitions between JSPs, copying header and footer in both JSPs, validating information, and so on, will be accomplished based on Struts capabilities and respecting Struts architecture. Obviously, because we want to do this fast and easy, we will use Struts Tools.

The following diagram presents our application in Struts style and using Struts terminology (to understand it, think in Struts!). This may look a little complicated at the moment, so you may want to come back to it after you have read a little further and things start becoming clearer.

Struts Tools
主站蜘蛛池模板: 独山县| 阿瓦提县| 民勤县| 峨边| 门源| 新化县| 永修县| 余姚市| 德化县| 交城县| 嘉峪关市| 竹山县| 太保市| 绥江县| 鄂托克旗| 廉江市| 河东区| 驻马店市| 桃源县| 和田市| 宁海县| 闽清县| 漯河市| 蓬溪县| 叶城县| 汶川县| 伊吾县| 吉隆县| 富源县| 西安市| 庄河市| 沛县| 建瓯市| 剑河县| 南木林县| 鄯善县| 荣昌县| 新乡市| 金华市| 旬阳县| 洪湖市|