Struts 2 ValueStack tutorial


A valueStack is just a stack that contains application explicit objects , for example, activity objects and other model object.

At the execution time, activity is put on the highest point of the stack.

We can place protests in the valuestack, query it and delete it.


ValueStack Interface

The struts 2 system provides an interface to manage valuestack. It gives numerous helpful methods.

Methods of ValueStack interface

There are numerous strategies in ValueStack interface. The ordinarily utilized techniques are as per the following:

public String findString(String expr) finds the string by assessing the given expression.

public Object findValue(String expr) finds the incentive by assessing the predetermined expression.

public Object findValue(String expr, Class c) finds the incentive by assessing the predetermined expression.

public Object peek() It returns the article situated on the highest point of the stack.

public Object pop() It returns the item situated on the highest point of the stack and expels it.

public void push(Object o) It puts the item on the highest point of the stack.

public void set(String key, Object value) It sets the item on the stack with the given key. It very well may be get by calling the findValue(key) method.

public int size() It restores the quantity of objects from the stack.






javacodegeeks is optimized for learning.© javacodegeeks .
All Right Reserved and you agree to have read and accepted our term and condition