title: javax.el.PropertyNotFoundException: Target Unreachable, identifier [MyController] resolved to null with Spring Boot and JSF
body: <p>I'm facing some issue that doesn’t make sense to me. I'm getting an "identifier resolved to null" when trying to use a selectOneMenu in a jsf page. </p>
  
  <p>I do know this happens when the controller is not being resolved or the field is null, however: i) if I remove the selectOneMenu, everything works fine (including other fields binding to attributes of the same controller); ii) the field target of my selectOneMenu is a non-null String. Here is my code:</p>
  
  <pre><code>&lt;h:selectOneMenu id="brandAccess" value="#{myController.field}" title="" &gt;
     &lt;f:selectItem itemValue="Item1" itemLabel="Item1" /&gt;
     &lt;f:selectItem itemValue="Item2" itemLabel="Item2" /&gt;
     &lt;f:selectItem itemValue="Item3" itemLabel="Item3" /&gt;
  &lt;/h:selectOneMenu&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>@ManagedBean(name = "myController")
  @SessionScoped
  public class MyController implements Serializable {
     private String field; //Makes no difference with new String()
     public void setField(String field) { this.field = field; }
     public String getField() { return this.field; }
  }
  </code></pre>
  
  <p>Edit:</p>
  
  <p>The indicated question leads to two possible roots: </p>
  
  <p>1) controller is null, not accessible or wrongly defined in the xhtml file: this is not the case. If I remove this particular component, everything else works fine.</p>
  
  <p>2) Field doesn't exist or is null: Not the case, also. The field does exist and it is not null. Also, tried creating a new field and it is still not working</p>
  
  <p><strong>Update</strong></p>
  
  <p>For whoever is having the same issue with Spring and JSF: I cannot answer as the question was marked as duplicated. My case was a bit different from the ones related to the other question: the issue was that  Spring wasn't creating my controller. For some reason, the error doesn't occur with <code>h:inputText</code> for example, but it does with <code>h:selectOneMenu</code>. Fixing is quite simple: just annotate the controller with <code>@Controller</code> (even though this is not a Spring Controller) and Spring will do the rest of the work.</p>