title: @ManagedProperty - Inject one request scoped bean into another request scoped bean
body: <p>I have this <strong>SearchBean</strong>:</p>
  
  <pre><code>@ManagedBean(name = "searchBean")
  @RequestScoped
  public class SearchBean implements Serializable
  {
      private String input = null;
  
      // getter methods
      public String getInput() {
          return input;
      }
  
      // setter method
      public void setInput(String input) {
          this.input = input;
      }
  
      public String Submit() {
          return null;
      }    
  }
  </code></pre>
  
  <p>Can I inject it into another bean using @ManagedProperty. For example:</p>
  
  <pre><code>@ManagedBean(name = "bookBean")
  @RequestScoped
  public class BookBean implements Serializable
  {
      @ManagedProperty(value = "#{searchBean}")
      private SearchBean searchBean;  
  
      @PostConstruct
      public void init()
      {   
         System.out.println("Value: " + searchBean.getInput());
      }
  
      public SearchBean getSearchBean() {
         return searchBean;
      }
  
      public void setSearchBean(SearchBean searchBean) {
         this.searchBean = searchBean;
      }   
  }
  </code></pre>
  
  <p>And the Facelet (search.xhtml):</p>
  
  <pre><code>&lt;h:form id="formSearch"&gt;
     &lt;h:commandButton value="Search" action="#{searchBean.Submit}" /&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p><strong>UPDATE</strong>: I have <code>search.xhtml</code> inserted into <code>book.xhtml</code> via a <code>ui:insert</code> component as follow:</p>
  
  <pre><code>&lt;h:form id="formBooks"&gt;
     &lt;ui:insert name="search"&gt;
        &lt;ui:include src="/templates/common/search.xhtml"/&gt;
     &lt;/ui:insert&gt; 
  &lt;/h:form&gt;
  </code></pre>
  
  <p>The <code>searchBean.getInput()</code> method above should return a value as a result of a form's submission. Is the above method of injection possible?</p>