Re: Getting Value from Id in a LIst

2014-05-01 Thread Antonio Sánchez
Sorry, maybe I'm not expressing my question accurately. I understand this is NOT the right approach for implementing this specific case, but I'm using it as an example to ask for that OGNL expression. Finally, I believe I have found it (it works for me): Given PersonAction: publ

Re: Getting Value from Id in a LIst

2014-05-01 Thread Dave Newton
It's not the syntax that's an issue, it's how you're implementing your data transfer. There's no "syntax" for retrieving a persisted object by ID beyond what OGNL's expression language (EL) provides. You can call arbitrary methods. The problem with doing that on the view layer on a row basis is t

Re: Getting Value from Id in a LIst

2014-05-01 Thread Antonio Sánchez
Yes, that the obvious way. Thank you. But guess there is some situation where the view needs asking to the controller for some data passing some parameter. Although the example is not the best one, suppose PersonAction has Map get Countries(), which is called in prepare(). Is there any syntax

Re: Getting Value from Id in a LIst

2014-05-01 Thread Dave Newton
If you only have an ID then you need to join the Country model; this seems obvious. You should do all that on the Java side to avoid the N+1 issue. Dave On Thu, May 1, 2014 at 10:58 AM, Antonio Sánchez wrote: > Hello. > > Person CRUD. > > Person bean has name, age... and "countryId". Country

Getting Value from Id in a LIst

2014-05-01 Thread Antonio Sánchez
Hello. Person CRUD. Person bean has name, age... and "countryId". Country bean has countryId and countryName. In persons.jsp all persons are listed, displaying rows for each person, and columns for name, age... but countryName must be displayed instead of countryId: I can display countr