Value Stack Importance
The ValueStack is like a normal stack.
You can put objects on it, remove them from it, and query it. And even more, you can query it with expressions!
It's the heart of Struts 2, and allows easy access to a wide range of objects from nearly any place in the framework: interceptors, results, tags, ... you name it.
Your action is placed on top of the stack when it is executed.
Once it's on the valueStack, you could query for it 'employees' - a special glue language called OGNL will then transform that request to 'top.getEmployees()' - and since top is the top of your stack, and your Action is located just there, it will invoke the getEmployees() method on your Action, and return the result.
You can put objects on it, remove them from it, and query it. And even more, you can query it with expressions!
It's the heart of Struts 2, and allows easy access to a wide range of objects from nearly any place in the framework: interceptors, results, tags, ... you name it.
Your action is placed on top of the stack when it is executed.
Once it's on the valueStack, you could query for it 'employees' - a special glue language called OGNL will then transform that request to 'top.getEmployees()' - and since top is the top of your stack, and your Action is located just there, it will invoke the getEmployees() method on your Action, and return the result.