I have a problem with JSF 2.2. My managerbean is not solved and this error appear. I used spring, hibernate, primefaces and tomcat.
Error:
value="#{appBean.stockSave.adi}": Target Unreachable, identifier 'appBean' resolved to null
index.html
<p:outputLabel value="Name" />
<p:inputText value="#{appBean.stockSave.name}" />
<p:outputLabel value="Type" />
<p:inputText value="#{appBean.stockSave.type}" />
<p:outputLabel value="Stock No" />
<p:inputText value="#{appBean.stockSave.stockNo}" />
<p:growl id="growl" life="2000" />
<p:commandButton value="SEND" id="ajax" update="growl"
action="#{appBean.sendDatabase}"
styleClass="ui-priority-primary" />
appBean.java
@ManagedBean
@SessionScoped
public class appBean implements Serializable
{
Stock stockSave = new Stock();
public Stock getStockSave() {
return stockSave;
}
public void setStockSave(Stock stockSave) {
this.stockSave = stockSave;
}
public String sendDatabase()
{
System.out.println("Test");
ApplicationContext appContext =
new ClassPathXmlApplicationContext("StokTakip/BeanLocations.xml");
StockBo stockBo = (StockBo)appContext.getBean("stockBo");
stockBo.save(stockSave);
return null;
}
}