java - JSF bean URLAction gets called everytime -


@named @requestscoped @urlmapping(id = "unblock", pattern = "/unblock", viewid = "/unblock.xhtml") public class unblock {  @urlaction public void load(){     //initialize values.. }  public void sendrequest(){  } 

and in xhtml file;

 <h:commandbutton id="submit action="#{unblockaccount.sendrequest}" 

now when first time page loads load method gets called correctly, when click submit button on page , call "sendrequest" method, load method gets called again.

how can stop this? tried use @viewscope didnt help

add onpostback=false @urlaction stop action being called on postback.

a post request initiated on jsf view after fresh request view

    @urlaction(onpostback=false)     public void load(){       //initialize values..     } 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -