Home Struts Struts2.3.15.1 Value Stack / OGNL
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

Value Stack / OGNL

Advertisement
Object Graph Navigational Language (OGNL) is a open source framework used to get properties from Java Beans. In Struts 2 framework, OGNL provides way to access objects within the value stack.

Value Stack / OGNL

Object Graph Navigational Language (OGNL) is a open source framework used to get properties from Java Beans. In Struts 2 framework, OGNL provides way to access objects within the value stack.

OGNL is a fully featured expression language. In Struts 2 framework, it works along with Value Stack to handle requests.

OGNL uses dot notation to navigate object graphs.

OGNL also supports following features:

  • type conversion
  • calling methods
  • collection manipulation and generation
  • projection across collections
  • expression evaluation
  • lambda expressions

Value Stack is a stack of objects. Whenever a user sends a request a Value Stack object is created. Value Stack also gets the references to request attributes, Session attributes and Application context.

Value Stack has following objects:

  1. Temporary Objects
  2. Model Object
  3. Action Object
  4. Named Objects

Control Tags along with expression are used to access properties of objects in value stack.

Data Tags are used to manipulate the value stack.

If the value you are querying about exists in the value stack, it will be returned regardless of where it is - the action, the model, or the HTTP request. Every element is queried for the value till it is found or stack ends.

However, if the property is common than the value returned may not be what you expect.

Advertisements

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: September 21, 2013

Ask Questions?    Discuss: Value Stack / OGNL  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com