Questions tagged [valuestack]

The ValueStack is a context for the beans evaluated via the EL expressions.

The ValueStack is a context for the beans evaluated via the EL expressions. ValueStack allows multiple beans to be pushed in and dynamic EL expressions to be evaluated against it. When evaluating an expression, the stack will be searched down the stack, from the latest objects pushed in to the earliest, looking for a bean with a getter or setter for the given property or a method of the given name (depending on the expression being evaluated).

One of the known implementations of the ValueStack is OGNL (Object Graph Notation Language). OGNL allows for dynamic OGNL expressions to be evaluated against it.

The XWork provides extension to OGNL and support for the ValueStack. While OGNL operates under the assumption there is only one "root", XWork's ValueStack concept requires there be many "roots".

The value value stack internals page: http://struts.apache.org/docs/value-stack-internals

92 questions
1
vote
1 answer

How to use OGNL index reference operator

Working with OGNL you can reference action context objects like #application, #session,#root, #action,#request,#parameters,#attr, and the action context with #context. The framework sets the OGNL context to be our ActionContext, and the value…
Roman C
  • 49,761
  • 33
  • 66
  • 176
1
vote
2 answers

Retrieving values from list in execute() method

I want list of items to be displayed along with each having a blank textfield to fill amount on my JSP page and once I fill the required items amount, I will submit. I have ExampleAction class as below, where I have populate() method which I fire…
Rahul Y
  • 38
  • 7
1
vote
2 answers

After using the ModelDrivernInterceptor, how to access Action properties in result JSP page?

In Struts2, after using ModelDrivernInterceptor, the data is located in a model object, And the model is been pushed to the ValueStack. then, after this. How to access the Action's property?
lovespring
  • 19,051
  • 42
  • 103
  • 153
1
vote
3 answers

s:iterator with collection of Object array

I have a ArrayList which contains a list of Object array Eg: new Object ['a','b','c'] The list is a member variable of data object. Now, how can I access each 3 element data while iterating it in the s:iterator tag loop
Harshana
  • 7,297
  • 25
  • 99
  • 173
1
vote
2 answers

How to push url onto value stack in Struts 2

I'm using Struts 2.3.16. How do I push an action URL onto the value stack? I've tried:
Mike M
  • 43
  • 1
  • 6
1
vote
1 answer

Pass Arraylist from Java class and fetch it in JSP page in Struts 2

I am trying to get ArrayList in JSP page passed from java class. But eventually I didn't succeed. Here is what I have done: Here is my POJO class: public class Coordinates { private double latitude; private double longitude; public double…
user2983355
  • 53
  • 2
  • 10
1
vote
0 answers

Struts 2 and valueStack

I have a problem with the value staack in Struts 2. Let's say I have an object called 'Article' and to this article I can upload some photos. Inputs like this:
Toni Montero
  • 113
  • 1
  • 6
1
vote
1 answer

Understanding OGNL expressions in Struts2

The following code displays links using of Struts starting from 1 to 10.
Tiny
  • 27,221
  • 105
  • 339
  • 599
1
vote
1 answer

How to get the sum of values inside Struts 2 iterator?

My application is shopping website application. In place order case, I need to pass the sum of every item's price as a one parameter. Prices are coming to the iterator correctly. But I failed to get the sum of those prices. shopping cart list is…
begginerAll
  • 159
  • 7
  • 19
1
vote
1 answer

How does Struts2 ValueStack take care of multiple requests

I understand ValueStack was introduced in Struts2 and one more change from Struts1 model is now a new ActionObject is instantiated for each request. So we can define instance variables without worrying about multi threading issues. The way…
1
vote
2 answers

How to retrieve data from Struts 2 using OGNL

I need to show registered user to users, Here am using Struts2 and I am very new it. But I know how to retrieve the elements without using Struts 2 there I will use collection set all the elements inside collection and I will put that in request…
user2838630
  • 91
  • 1
  • 5
  • 15
1
vote
3 answers

Struts 2 textfield displays the value even without the value attribute

I have a Struts 2 textfield tag where I just need to get a user enter value and send to the action. Even when this page loads user object contains…
Harshana
  • 7,297
  • 25
  • 99
  • 173
1
vote
1 answer

Dynamically getting One list value with the key of another list value

Dear Friends, I have a iterator with one list. I had another iterator inside previous iterator. I want to show first list value by the key of second list value. How to acheieve that. Please help me.
maan
  • 23
  • 4
1
vote
1 answer

Custom OgnlValueStack in Struts 2

I want to implement a custom ValueStack in my application by extending the OgnlValueStack class of Struts 2.3.x. Please let me know how to accomplish this. What classes do I need to extend and implement in my application and how to inject different…
user1093127
  • 21
  • 1
  • 3
1
vote
1 answer

Checking for membership of "top" value using OGNL in Struts 2

I am using Struts 2 with JSP templates and the Struts 2 tags. With these, I can't seem to check for membership of a value in a HashMap. The map is set up correctly, there is a List I'm iterating over, and I would like to check if the element…
wds
  • 31,873
  • 11
  • 59
  • 84