-
1. Re: Accessing static finals
cptnkirk Jul 15, 2006 10:44 PM (in response to bluetrade)You can't outject from entities and by default the EL requires getters/setters. I was thinking that a custom JSF VariableResolver might help, but it seems that it only resolves the top-level object (ie, the entity), not the actual returned variable.
I think you're SOL here, unless the JSF EL in 1.2 has changed to support this (or supports new extension points that I'm unaware of). If you really, really can't just add getter/setters to your entity, then you can use cglib or some other class manipulation library to generate those getters/setters for you.
I experimented with this in the past and it worked, but is probably overkill for your needs.
Now just because Entities don't outject doesn't mean you couldn't have a Seam component lookup and outject that static variable (and then inject and set the variable). Although this brings us, why not just have getter/setters?
If you really wanted to you may also be able to abuse a custom DataBinder into doing what you want as well. -
2. Re: Accessing static finals
cptnkirk Jul 15, 2006 11:02 PM (in response to bluetrade)A less crazy solution might be to simply access your entity via a session/conversation scoped Seam component wrapper/decorator. Still could be more trouble than it's worth.