0

I'm trying to add another value to a an Array..

<%= ProductManager.getAddItems(new String[] {((String)pageContext.getAttribute("skuId"))}, (Order)pageContext.getAttribute("order"), request,response) %>

I want to add pageContext.getAttribute("qty") to the above String array but just can't seem to get it to work. Google the subject to death and not finding any examples of what I'm trying to accomplish.. any suggestions would be MUCH appreciated!

2
  • You are creating array of string and you are putting string and Order both different object in the array how it will work..? Commented Dec 7, 2015 at 14:01
  • No, the array only has one element, the one with the string cast. Commented Dec 8, 2015 at 0:11

1 Answer 1

1

Something like this should work (havent tried it in in a console yet though)

<%= ProductManager.getAddItems(new String[] {((String)pageContext.getAttribute("skuId")), ((String)pageContext.getAttribute("qty"))}, (Order)pageContext.getAttribute("order"), request,response) %>
Sign up to request clarification or add additional context in comments.

2 Comments

Awesome.. but I could have sworn I tried that.. it does work though :)
I think you can remove the outer-parentheses for both strings in the array aswell, just for the sake of better readability :)

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.