[weld-dev] @Inject FacesContext

Dan Allen dan.j.allen at gmail.com
Tue Nov 10 17:03:21 EST 2009


I couldn't imagine writing a JSF application without accessing FacesContext.
It's not even a matter of a perfect world vs the real world. The
FacesContext was designed to be accessed. Add faces messages. Push a file.
Check the value of a UIComponent for cross field validation. I'm sure I
could think of many other cases.

Having to access using FacesContext.getCurrentInstance() is so ugly.

-Dan

On Tue, Nov 10, 2009 at 4:07 PM, Gavin King <gavin.king at gmail.com> wrote:

> Why do you want to access them directly? Surely that's what we're
> trying to get away from?
>
> On Tue, Nov 10, 2009 at 4:02 PM, Nicklas Karlsson <nickarls at gmail.com>
> wrote:
> > ...and the HTTP session and request. Probably something most
> > frameworks will provide if nothing else.
> >
> > On Tue, Nov 10, 2009 at 10:50 PM, Dan Allen <dan.j.allen at gmail.com>
> wrote:
> >> Is the following injection going to be supported in Java EE 6?
> >>
> >> @Inject FacesContext ctx;
> >>
> >> Because I can't even begin to count how many times I'm going to need
> that
> >> when developing apps. Probably the #1 injection in JSF apps.
> >>
> >> (True, I could make a producer method myself, but so will the n-thousand
> >> other JSF developers).
> >>
> >> -Dan
> >>
> >> --
> >> Dan Allen
> >> Senior Software Engineer, Red Hat | Author of Seam in Action
> >> Registered Linux User #231597
> >>
> >> http://mojavelinux.com
> >> http://mojavelinux.com/seaminaction
> >> http://www.google.com/profiles/dan.j.allen
> >>
> >> _______________________________________________
> >> weld-dev mailing list
> >> weld-dev at lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/weld-dev
> >>
> >
> >
> >
> > --
> > ---
> > Nik
> > _______________________________________________
> > weld-dev mailing list
> > weld-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/weld-dev
> >
>
>
>
> --
> Gavin King
> gavin.king at gmail.com
> http://in.relation.to/Bloggers/Gavin
> http://hibernate.org
> http://seamframework.org
>



-- 
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597

http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://www.google.com/profiles/dan.j.allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20091110/4e7319e7/attachment-0001.html 


More information about the weld-dev mailing list