• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

get data from valueStack inside an action

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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 ------------------
search_button

table - jquery grid
--------------------------------------
--col1 -+- col2 -+- col3 -
--------------------------------------
value1 value2 value3

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?

Regards,
Javanus
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of course--OGNL (and JSTL) resolve against the value stack. That's how Struts 2 works.
 
Armin Vetek
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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"));

Could you give me a tip?

Regards,
Javanus
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic