First method is normal action method and it only returns String to process navigation. Second method sends email and it takes some time to finish , but I don't want to wait. I want only to start second method and go to page indicated by first method.
Any ideas how to resolve this problem?
My code looks like this now, it works but I have to wait for second method (sendEmail):
Code: Select all
...
<p:commandButton action="#{myBean.goToPage}" actionListener="#{myBean.sendEmail}" />
...
public String goToPage(){
return "page"
}
public void sendEmail(){
EmailUtils.send();
}