Note that there are some explanatory texts on larger screens.

plurals
  1. POGuice and JSF 2
    primarykey
    data
    text
    <p>I'm trying to use Guice to inject properties of a JSF managed bean. This is all running on Google App Engine (which may or may not be important)</p> <p>I've followed the instructions here:</p> <p><a href="http://code.google.com/docreader/#p=google-guice&amp;s=google-guice&amp;t=GoogleAppEngine" rel="nofollow noreferrer">http://code.google.com/docreader/#p=google-guice&amp;s=google-guice&amp;t=GoogleAppEngine</a></p> <p>One problem is in the first step. I can't subclass the Servlet module and setup my servlet mappings there because Faces is handled by the javax.faces.webapp.FacesServlet which subclasses Servlet, not HttpServlet. So, I tried leaving my servlet configuration in the web.xml file and simply instantiating a new ServletModel() along with my business module when creating the injector in the context listener described in the second step.</p> <p>Having done all that, along with the web.xml configuration, my managed bean isn't getting any properties injected. The method is as follows</p> <pre><code>@ManagedBean @ViewScoped public class ViewTables implements Serializable { private DataService&lt;Table&gt; service; @Inject public void setService( DataService&lt;Table&gt; service ) { this.service = service; } public List&lt;Table&gt; getTables() { return service.getAll(); } } </code></pre> <p>So, I'm wondering if there is a trick to get Guice injecting into a JSF managed bean? I obviously can't use the constructor injection because JSF needs a no-arg constructor to create the bean.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload