1

I'm trying to get a value from an array into a s:textbox element: it works if I take a hard coded index like:

<s:textarea  value="%{languageHelper.myHauptuebbeschr[0]}" />

but when I try to use a dynamic index it doesn'T work:

<s:textarea  value="%{languageHelper.myHauptuebbeschr[attr.number]}" />

Number is not empty, I can get the value via

<s:property value="%{#attr.number}" />

So how can I use the number variable as index for my array?

2 Answers 2

2

shouldn't it be:

<s:textarea  value="%{languageHelper.myHauptuebbeschr[#attr.number]}" />
Sign up to request clarification or add additional context in comments.

Comments

0

I found a solution:

I first save the value in an addtional variable:

<c:set var="myHauptuebbeschr" value="${languageHelper.myHauptuebbeschr[number]}" ></c:set>

and then get it via:

<s:textarea  value="%{#attr.myHauptuebbeschr}"  />

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.