O'Reilly logo

Struts 2 Design and Programming: A Tutorial by Budi Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Type Conversion

In Chapter 5, “Form Tags” you learned to use form tags to receive user inputs and submit them to an action object. In Chapter 6, “Generic Tags” you saw how those values could be displayed. In both chapters you witnessed type conversions.

From an HTML form to an action object, conversions are from strings to non-strings. All form inputs are sent to the server as request parameters and each form input is either a String or a String array because HTTP is type agnostic. At the server side, the web developer or the framework converts the String to another data type, such as an int or a java.util.Date.

As you will learn in this chapter, Struts supports type conversions seamlessly. In addition, this feature is extensible, so ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required