/createBook.xhtml @13,82 value="#{bookController.book.title}": Target Unreachable, 'null' returned null
The #{bookController}
is not available anywhere in the scope. This is normally the responsibility of @Named
annotation. This annotation will only be scanned on webapp's startup when there's a /WEB-INF/beans.xml
file present. So make sure that that file is present (it can be kept empty).
Alternatively, you can also just use the standard JSF annotations:
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
@ManagedBean
@ViewScoped
public class BookController {
// ...
}
(note that I didn't use javax.faces.bean.SessionScoped
because that's the wrong scope for a normal controller; if it was used, the same bean instance would be shared among multiple browser tabs/windows in the same session which would only lead to unintuitive webapp behaviour)