I would like to execute a method once the link is being clicked and the new page is loaded. I have tried the <action/>
tag as but this didn't help either :
<url-mapping id="myApp/seller/addProduct">
<pattern value="/myApp/seller/addProduct" />
<view-id value="/pages/seller/add_product.xhtml" />
<action onPostback="false">#{myBean.barMethod}</action>
<action>#{myBean.myMethod}</action>
</url-mapping>
@Bean
public class MyBean{
//source code omitted
public void myMehtod(){
//source code omitted
}
}
I tried debugging the method execution. The call is never made after the page is loaded. How can I solve this problem please?
UPDATE : After debugging this problem for hours, I came to the result that the first action myBean.barMethod()
is always executed while the second myBean.myMethod()
is never fired which I don't understand pretty much why??