i have a navigation list with pure page-to-page navigation:
<h:link outcome="/admin/products"> Products </h:link>
<h:link outcome="/admin/users"> Users </h:link>
<h:link outcome="/admin/markets"> Markets </h:link>
the first time i call a page, everything is well. the stuff at the destination-pages with ViewScoped-Beans looks like this:
@ManagedBean
@ViewScoped
public class ProductBean {
private List<Products>products;
private int total = 0;
@PostConstruct
public void init(){
this.products = Products.getAll();
}
public void newProduct(){
this.total++;
}
public Integer getTotal(){
return total;
}
}
products.xhtml
<h:form id="productForm" prependId="false">
<h:commandLink value="Add Product" actionListener="#{bean.newProduct}">
<f:ajax render="productsBox" />
</h:commandLink>
<h:panelGroup id="productsBox">
<h:outputText value="#{bean.total}"/>
</h:panelGroup>
</h:form>
triggering an action at one of the pages, results then in slow page reload when i click on "Products" again or reload the page using F5, or in other words it tooks long time until init() of the ProductBean is called, even when i broke down all logic to a minimal setup like here.
the behaviour seems to be some kind of undefined. sometimes the page-reload is just a bit slower, then very slow or page-load just hangs up.
NOTE: when i replace the h:link with h:commandLink action="/admin/products" everything works as "normal". but as i learnt a commandLink is not required here.
what can i do or what is wrong?
using jsf 2.2 and mojarra 2.2.12 and tomcat 8
thanks in advance.