Sunday, March 15, 2009

Struts - Accessing Value Stack in interceptors

Values which are set in action classes can be accessed and modified in interceptors
using the struts value stack object

Code in interceptor

ValueStack valueStack = actionInvocation.getStack();

Object object = valueStack.findValue(objectName);

if (object instanceof List) {
......

can access here directly and modify it which will be reflected in the viewing JSP

}

This method of accessing of modifying the Struts value stack will have wide applications.

No comments:

 
Free Domain Names @ .co.nr!