You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by stanlick <st...@gmail.com> on 2008/03/10 19:33:57 UTC
ValueStack.findValue(...)
I am working on a custom result type and a weird scenario.
If I issue vs.findValue("employees");
the getEmployees() is called on my action just fine.
However issuing vs.findValue("employee('e9874v')");
for a specific employee, I get a null value!
If I change th syntax to vs.findValue("getEmployee('e9874v')");
it returns the employee.
What's up with the funky requirement? "employees" finds getEmployees()
--
View this message in context: http://www.nabble.com/ValueStack.findValue%28...%29-tp15951133p15951133.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: ValueStack.findValue(...)
Posted by Chris Pratt <th...@gmail.com>.
On Mon, Mar 10, 2008 at 11:33 AM, stanlick <st...@gmail.com> wrote:
>
> I am working on a custom result type and a weird scenario.
>
> If I issue vs.findValue("employees");
>
> the getEmployees() is called on my action just fine.
>
> However issuing vs.findValue("employee('e9874v')");
>
> for a specific employee, I get a null value!
>
> If I change th syntax to vs.findValue("getEmployee('e9874v')");
>
> it returns the employee.
>
> What's up with the funky requirement? "employees" finds getEmployees()
I believe, though I could easily be wrong, that when you use the
JavaBeans reference, anything in the parenthesis is considered a Map
reference, so it treats the return from getEmployee() as a map and
attempts to look up "e9874v", which of course fails and returns a
null. When you use the OGNL method syntax, it considers things in
parenthesis to be arguments to the method, so the call works as you're
expecting.
(*Chris*)
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org