I have an application running JSF2.0 on the front end. In the backend instead of using managed beans I'm using weld's named beans. The bean in question is annotated @Named @Singleton @Startup and is an EJB Singleton. The bean gets the top level category to populate the front end. In the top level navigation of the front end I have code that look like so
<h:dataTable var="items" value="#{topCategorySingleton.topCat}">
<h:column>
<h:commandLink class="menu-link" action="#{categoryBackingBean.category}">
<f:setPropertyActionListener target="#{categoryBackingBean.catID}" value="#{item.sku}" />
<h:outputText value="#{item.title}" />
</h:commandLink>
</h:column>
</h:dataTable>
When this code runs I get an error stating javax.servlet.ServletException: The class 'com.webintel.backingbeans.org$jboss$weld$bean-testing-SessionBean-CategoryBackingBean_$$_WeldProxy' does not have the property 'category'.
I thought the action attribute of commandLink should bind to a method of the bean, not a property? Anyone have any ideas?
At startup the @Singleton is started and the code as follows:
@Singleton
@Named
@Startup
@ConcurrencyManagement(CONTAINER)
public class TopCategorySingleton{
public TopCategoryStingleton(){}
private int sku;
private String title;
private List<TopCategorySingleton> topCat;
....getters and setters
public void getTop_Cat(){
....logic
setTopCat(List<TopCateogrySingleton>);
}
Then the backing bean code look like so:
@Stateless
@Named
@RequestScoped
public class CategoryBackingBean{
public CategoryBackingBean(){}
private int catID;
....getters and setters
public String category(){
...logic
if(!true){
return "error";
}
return "success";
}
For some reason it is still not binding the categoryBackingBean.category to the method. I am running this app on a Glassfish 3.1 server with Java 6. Thanks in advance for your help.