I have a jsp page which consists from some criteria fields and jquery-grid. The forms looks like that:
criteria field1 -----------------
criteria field2 -----------------
criteria field3 ------------------
FormAction is called when search_button is pressed. Values from FormAction are put on ValueStack.
JSonAction which is used to render a jquery grid table is called from the jsp page. I would like to read criteria fields which are stored on ValueStack from another action (JSonAction).
Is it possible to get a value from ValueStack inside an action in struts2?
Of course--OGNL (and JSTL) resolve against the value stack. That's how Struts 2 works.
Joined: Aug 21, 2010
I understand how to get the value from valueStack in jsp.
I do not know how to get the value from ValueStack inside an action.
Struts ValueStack Debug shows the following: Value Stack Contents
Object Property Name Property Value
dao.RequestAction status NEW
Code below returns null. I would like to get the value for status field from object dao.RequestAction. I tried the following:
ValueStack stack = ActionContext.getContext().getValueStack();
System.out.println("Status = " + stack.findString("dao.RequestAction"));