You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by appfan <to...@motricity.com> on 2007/11/30 14:27:51 UTC

OGNL Object indexed properties in Struts2

I'm working with Struts2 and I have on the value stack an object with the
following methods:

public void setProperty(String index, Object value)
public Object getProperty(String index)

According to the OGNL docs, I should be able to retrieve properties from
this object using something like this:  object["propertyname"].

But this doesn't work when the object is on the value stack.  If I put the
object directly in the action context like this:

ActionContext.getContext().put("Result", object)

I can then do this:

#Result.property["propname"]

which does work.  So basically my question is why does this syntax not work
when the object is on the value stack, and is this intended behavior?
-- 
View this message in context: http://www.nabble.com/OGNL-Object-indexed-properties-in-Struts2-tf4909286.html#a14056721
Sent from the Struts - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org