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 4. OGNL

The view in the Model-View-Controller (MVC) pattern is responsible for displaying the model and other objects. To access these objects from a JSP, you use OGNL (Object-Graph Navigation Language), the expression language Struts inherits from WebWork.

OGNL can help you do the following.

  • Bind GUI elements (text fields, check boxes, etc) to model objects and converts values from one type to another.

  • Bind generic tags with model objects.

  • Create lists and maps on the fly, to be used with GUI elements.

  • Invoke methods. You can invoke any method, not only getters and setters.

OGNL is powerful, but only part of its power is relevant to Struts developers. This chapter discusses OGNL features that you will need for Struts projects. If you’re interested ...

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