concept ognl in category java

This is an excerpt from Manning's book Struts 2 in Action.
OGNL is the tool that allows us to access the data we put in that central repository. More specifically, it is an expression language that allows you to reference and manipulate the data on the ValueStack. Developers new to Struts 2 probably ask more questions about the ValueStack and OGNL than anything else. If you’re coming from Struts 1, you’ll find that these are a couple of the more exotic features of the new framework. Due to this, and the sheer importance of this duo, we’ll treat them carefully throughout the book. In particular, chapters 5 and 6 describe the detailed function of these two framework components.
As of version 2.1 of Struts 2, which will most likely be available by the time this book is printed, the expression language used by the framework will become pluggable. While this may sound unsettling, it’s actually harmless. You can use OGNL, just as described in this book, or you can insert your own expression language into the framework. Any EL plugged into Struts 2 will have access to the same data and will serve the same purposes as we’ve described for OGNL. But don’t panic: you can just use OGNL! Besides, it might be several versions before switching ELs becomes well established.
As far as the full syntax of OGNL goes, we’ll wait a bit on that. In the previous chapter, we saw as much of the OGNL syntax as we needed for writing our input field names that would target our properties. At the most complex, this included expressions that could reference map entries via string and object keys. But OGNL is much more. The OGNL expression language contains many powerful features, including the ability to call methods on the objects you reference. While these advanced features give you a set of flexible and powerful tools with which to solve the thorn that you inevitably find stuck in your side late on a Friday afternoon, they aren’t necessary in the normal course of things. We’ll continue to delay full coverage of the OGNL expression language until the end of this chapter, preferring instead to only introduce as much as we need while demonstrating the tags. The main idea here is to understand the role that the expression language plays in the framework.
Now the value of the default attribute will be interpreted as OGNL, and the actual string used as the default string will be pulled from the myDefaultString property on the ValueStack.