Seam2 is able to have groovy file containing components, since groovy
1.1 does support annotations:
<snip>
...
import javax.persistence.Entity
import org.jboss.seam.annotations.Name
@Entity
@Name("booking")
class Booking implements Serializable
{
@Id @GeneratedValue
Long id
@ManyToOne @NotNull
Hotel hotel
...
}
</snip>
I was thinking about extending the MyFaces ManagedBean facility to
have support for groovy files as backing beans.
Like:
<managed-bean>
<managed-bean-name>foo</managed-bean-name>
<managed-bean-class>package.Foo.groovy</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
so, that when a file ends w/ *.groovy, that the class inside the
script can be used.
Never tried, but that was my thought.
-Matthias
On 10/19/07, Zied Hamdi <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Thinking I've found a great idea for a small open source project as soon as
> I'll finish with the currnent product I'm writing: an adapter to use Groovy
> instead of (in some conf file) el expressions. I took a look at the web and
> I see that the general movance is already in that sense:
>
> ADF faces has now native support for Groovy
> (http://radio.weblogs.com/0118231/2007/05/22.html), and
> Seam 2.0 beta seems to support it (I don't know how far).
>
> I'm know to JSF (6 months) But I know in the 1.2, El resolvers have been
> externalized so it's easy to imagine we adapt a Groovy resolver in that
> place. Seen what el does, I think theresn't a lot to do to have all
> interfaces implemented with the Groovy counterpart.
>
> Does anyone know if there's currently a project in that sens?
>
> I think facelets is a great candidate to support Groovy natively (or to
> define an entry point to scripts in general): that way it'd have both view
> (data) templating (as it already has) but also function templating (if I can
> say it like this). In fact this could resolve a lot of issues like 'why
> can't we pass a method as a prameter' and so on...
>
> Any votes? ;-p
>
> --
> Zied Hamdi
> zatreex.sourceforge.net
--
Matthias Wessendorf
further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org