<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><span style="font-family: arial,sans-serif; font-size: 13px; border-collapse: collapse;"><div>
The reason for injection is to be able to stub and unit test easily. Right now the getCurrentInstance() is static and you'd need to use ugly constructions to replace it with a stub (I am not saying it's impossible but I am talking here from the feedback I've gathered and personal experience when unit testing pure JSF).</div>
</span></blockquote><div><br>And the other, more subtle annoyance is the you have to eventually make that decision in a method when to create a local variable for FacesContext because your code is getting too verbose.<br>
<br>FacesContext ctx = FacesContext.getCurrentInstance(); <br></div></div><br>I hate writing that line. Every time I do, I think to myself "I hate this stupid line of code."<br><br>-Dan<br><br>-- <br>Dan Allen<br>
Senior Software Engineer, Red Hat | Author of Seam in Action<br>Registered Linux User #231597<br><br><a href="http://mojavelinux.com">http://mojavelinux.com</a><br><a href="http://mojavelinux.com/seaminaction">http://mojavelinux.com/seaminaction</a><br>
<a href="http://www.google.com/profiles/dan.j.allen">http://www.google.com/profiles/dan.j.allen</a><br>