Thursday, 15 August 2013

jsf - JSF2 An action is called two times -



jsf - JSF2 An action is called two times -

i'm using primefaces 4.0 (it's hard update because utilize older version of ie). jsf's library 2.1 (mojarra 2.1.6-fcs). projects running in tomcat7 on linux.

the problem comes when calling synchronously rest service , response greater of 10 minutes.

i have action calls rest service , kept waiting response, before response received, action executed again, @ 5 minutes of start of first execution of action

the web aplication , rest service in same tomcat 7. , web app calls rest service directly.

thank much

my code below

mypage.xhtml

<h:form> <p:commandbutton value="testing" actionlistener="#{mybean.testing}" update="@form" /> </h:form>

mybean.java

public class equipobean implements serializable { public void testing() { log.debug("init testing"); string url = rest_url+"control/sleepthread/12"; seek { //execute remote phone call string response = restclient.executerequest(restclient.http_get, url, null); } grab (exception e) { e.printstacktrace(); } log.debug("end testing"); } }

restservices.java (my rest services)

@get @path("sleepthread/{minutes}") public string sleepthread(@pathparam("minutes") integer minutes){ log.debug("init sleepthread " + minutes + " minutes"); seek { thread.sleep(minutes * 60 * 1000;); } grab (interruptedexception e) { e.printstacktrace(); } homecoming "ok" }

jsf jsf-2 primefaces action

No comments:

Post a Comment