Re: Continue navigating while on submit button process stuff on the background
Lucast is not good idea to make the Wicket application and spring bean directly (can't remember why, but look for it into the archive), instead the use of the CompenentInstantiaionListener is the recommended with the companion of the wicket @SpringBean annotation. On Thu, Apr 28, 2011 at 8:31 AM, lucast [via Apache Wicket] ml-node+3480723-1382859170-65...@n4.nabble.com wrote: Thank you Mzemeck, I am using Spring and I tried implementing @Async but for some reason when I fired up my wicket app it complained that it couldn't find the beans. I think it must have been because I'm declaring all of my spring managed beans (including my wicketApplication class) on my applicationContext file. Looking at the Task Execution and Schedulinghttp://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/htmlsingle/spring-framework-reference.html#scheduling section of the spring reference manual, I decided to use a TaskExecutorhttp://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/htmlsingle/spring-framework-reference.html#scheduling-task-executor-usage instead of using @Async annotations and it works perfectly with my current spring settings. I am autowiring spring beans on my WicketAppliation class. And I noticed that calling WicketApplication.get() from the taskExecutor kept throwing a WicketRuntimeException: There is no application attached to current thread taskExecutor-1 exception. I realised that I didn't need to call my db services from the taskExecutor since none of those tasks are time consuming, the sending emails is what is time consuming and that's what I limited the functionality of taskExecutor to. Thanks, once more for your help. Lucas -- If you reply to this email, your message will be added to the discussion below: http://apache-wicket.1842946.n4.nabble.com/Continue-navigating-while-on-submit-button-process-stuff-on-the-background-tp3473026p3480723.html To start a new topic under Apache Wicket, email ml-node+1842946-398011874-65...@n4.nabble.com To unsubscribe from Apache Wicket, click herehttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=1842946code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=. -- JC -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Continue-navigating-while-on-submit-button-process-stuff-on-the-background-tp3473026p3486071.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Ajaxifying existing application
Hi, i have a general question, we have an exisiting application, that now needs to be ajaxified (no page reloads etc..). This has never been a requirement, so the application is not prepared at all for this. The biggest problem we see is that we have many different pages, but how shall we do page switches using ajax? I look forward to any hints on this. Thank you very much.-- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Ajaxifying-existing-application-tp3486615p3486615.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Load balancer cookie is lost in modal window
Hello, I tried copying all cookies from the HTTP request to HTTP response and it seemed to have a positive effect (unless our hosting company fixed something on their load balancer). However, I would expect Wicket to copy cookies from request to response by default, is this true? Here is the code I added trying to fix the problem with the load balancer cookie being lost: // copy all cookies from parent page to modal window in order to support sticky sessions on load balancer Cookie[] cookies = ((WebRequest) getRequestCycle().getRequest()).getCookies(); for (Cookie cookie : cookies) { ((WebResponse) getRequestCycle().getResponse()).addCookie(cookie); } Thanks, Alec On Fri, Apr 29, 2011 at 4:17 PM, Alec Swan alecs...@gmail.com wrote: Hello, We just put our webapp behind a load balancer with sticky sessions. After that we started noticing that load balancer cookie gets lost when a modal window is popped up by a link click. Here is the code we use to display the modal window: new AjaxLink(editLink) { @Override public void onClick(AjaxRequestTarget target) { modalWindow.setPageCreator(new ModalWindow.PageCreator() { @Override public Page createPage() { } } }); How can we make sure that cookies get preserved when we pop up a modal window? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Load balancer cookie is lost in modal window
one does not need to copy cookies because browsers retain them across requests. -igor On Sat, Apr 30, 2011 at 5:01 PM, Alec Swan alecs...@gmail.com wrote: Hello, I tried copying all cookies from the HTTP request to HTTP response and it seemed to have a positive effect (unless our hosting company fixed something on their load balancer). However, I would expect Wicket to copy cookies from request to response by default, is this true? Here is the code I added trying to fix the problem with the load balancer cookie being lost: // copy all cookies from parent page to modal window in order to support sticky sessions on load balancer Cookie[] cookies = ((WebRequest) getRequestCycle().getRequest()).getCookies(); for (Cookie cookie : cookies) { ((WebResponse) getRequestCycle().getResponse()).addCookie(cookie); } Thanks, Alec On Fri, Apr 29, 2011 at 4:17 PM, Alec Swan alecs...@gmail.com wrote: Hello, We just put our webapp behind a load balancer with sticky sessions. After that we started noticing that load balancer cookie gets lost when a modal window is popped up by a link click. Here is the code we use to display the modal window: new AjaxLink(editLink) { @Override public void onClick(AjaxRequestTarget target) { modalWindow.setPageCreator(new ModalWindow.PageCreator() { @Override public Page createPage() { } } }); How can we make sure that cookies get preserved when we pop up a modal window? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Load balancer cookie is lost in modal window
Even if the next request is made from inside an IFrame? If so, is this problem definitely a problem with the load balancer setup? Our hosting company ran HTTP trace and said this: Customer connects to the cluster via HTTP, in this case they are routed to web2. This packet passes through the load balancer, where a cookie is added by the LB. It adds a cookie to every packet that comes back from the server, so that the next connection goes to the same server. In the next request from the client to the server, we see both cookies in place. This continues on normally for a while with all packet headers containing the Cookies above. web1 suddenly gets a request for https, that does not contain any cookies, this has to be a new connection, there are no LB or JSESSION Cookies in these packets. Then, the next request goes back to web2 at this point we know we're going to get an error, after the above happens. What happens is that the user is browsing the web site and then clicks a link which pops up a modal window with @RequireHttps annotation on it. This is when the modal window shows an error saying that page cannot be found in the page map. We continue working with the hosting company, but we would appreciate any thoughts on this. Thanks, Alec On Sat, Apr 30, 2011 at 6:16 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: one does not need to copy cookies because browsers retain them across requests. -igor On Sat, Apr 30, 2011 at 5:01 PM, Alec Swan alecs...@gmail.com wrote: Hello, I tried copying all cookies from the HTTP request to HTTP response and it seemed to have a positive effect (unless our hosting company fixed something on their load balancer). However, I would expect Wicket to copy cookies from request to response by default, is this true? Here is the code I added trying to fix the problem with the load balancer cookie being lost: // copy all cookies from parent page to modal window in order to support sticky sessions on load balancer Cookie[] cookies = ((WebRequest) getRequestCycle().getRequest()).getCookies(); for (Cookie cookie : cookies) { ((WebResponse) getRequestCycle().getResponse()).addCookie(cookie); } Thanks, Alec On Fri, Apr 29, 2011 at 4:17 PM, Alec Swan alecs...@gmail.com wrote: Hello, We just put our webapp behind a load balancer with sticky sessions. After that we started noticing that load balancer cookie gets lost when a modal window is popped up by a link click. Here is the code we use to display the modal window: new AjaxLink(editLink) { @Override public void onClick(AjaxRequestTarget target) { modalWindow.setPageCreator(new ModalWindow.PageCreator() { @Override public Page createPage() { } } }); How can we make sure that cookies get preserved when we pop up a modal window? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Load balancer cookie is lost in modal window
this is because cookies created in http are not transferred to https and viceversa afair. i think this can be changed by turning off secure cookies in tomcat or something like that. -igor On Sat, Apr 30, 2011 at 6:06 PM, Alec Swan alecs...@gmail.com wrote: Even if the next request is made from inside an IFrame? If so, is this problem definitely a problem with the load balancer setup? Our hosting company ran HTTP trace and said this: Customer connects to the cluster via HTTP, in this case they are routed to web2. This packet passes through the load balancer, where a cookie is added by the LB. It adds a cookie to every packet that comes back from the server, so that the next connection goes to the same server. In the next request from the client to the server, we see both cookies in place. This continues on normally for a while with all packet headers containing the Cookies above. web1 suddenly gets a request for https, that does not contain any cookies, this has to be a new connection, there are no LB or JSESSION Cookies in these packets. Then, the next request goes back to web2 at this point we know we're going to get an error, after the above happens. What happens is that the user is browsing the web site and then clicks a link which pops up a modal window with @RequireHttps annotation on it. This is when the modal window shows an error saying that page cannot be found in the page map. We continue working with the hosting company, but we would appreciate any thoughts on this. Thanks, Alec On Sat, Apr 30, 2011 at 6:16 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: one does not need to copy cookies because browsers retain them across requests. -igor On Sat, Apr 30, 2011 at 5:01 PM, Alec Swan alecs...@gmail.com wrote: Hello, I tried copying all cookies from the HTTP request to HTTP response and it seemed to have a positive effect (unless our hosting company fixed something on their load balancer). However, I would expect Wicket to copy cookies from request to response by default, is this true? Here is the code I added trying to fix the problem with the load balancer cookie being lost: // copy all cookies from parent page to modal window in order to support sticky sessions on load balancer Cookie[] cookies = ((WebRequest) getRequestCycle().getRequest()).getCookies(); for (Cookie cookie : cookies) { ((WebResponse) getRequestCycle().getResponse()).addCookie(cookie); } Thanks, Alec On Fri, Apr 29, 2011 at 4:17 PM, Alec Swan alecs...@gmail.com wrote: Hello, We just put our webapp behind a load balancer with sticky sessions. After that we started noticing that load balancer cookie gets lost when a modal window is popped up by a link click. Here is the code we use to display the modal window: new AjaxLink(editLink) { @Override public void onClick(AjaxRequestTarget target) { modalWindow.setPageCreator(new ModalWindow.PageCreator() { @Override public Page createPage() { } } }); How can we make sure that cookies get preserved when we pop up a modal window? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Load balancer cookie is lost in modal window
Thank you for the great hint! It seems like a lot of people have a problem JSESSIONID cookie being lost by Tomcat when switching from HTTPS to HTTP. We are switching in the opposite direction, but I assume the could be problematic as well. At this point we are willing to force HTTPS for the entire webapp in order to avoid this problem. What's the recommended way to force all requests to go over HTTPS in production and go over HTTP in development? Should we use transport-guaranteeCONFIDENTIAL/transport-guarantee in web.xml and also override protected IRequestCycleProcessor newRequestCycleProcessor() as explained here: https://cwiki.apache.org/WICKET/how-to-switch-to-ssl-mode.html Thanks, Alec On Sat, Apr 30, 2011 at 7:10 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: this is because cookies created in http are not transferred to https and viceversa afair. i think this can be changed by turning off secure cookies in tomcat or something like that. -igor On Sat, Apr 30, 2011 at 6:06 PM, Alec Swan alecs...@gmail.com wrote: Even if the next request is made from inside an IFrame? If so, is this problem definitely a problem with the load balancer setup? Our hosting company ran HTTP trace and said this: Customer connects to the cluster via HTTP, in this case they are routed to web2. This packet passes through the load balancer, where a cookie is added by the LB. It adds a cookie to every packet that comes back from the server, so that the next connection goes to the same server. In the next request from the client to the server, we see both cookies in place. This continues on normally for a while with all packet headers containing the Cookies above. web1 suddenly gets a request for https, that does not contain any cookies, this has to be a new connection, there are no LB or JSESSION Cookies in these packets. Then, the next request goes back to web2 at this point we know we're going to get an error, after the above happens. What happens is that the user is browsing the web site and then clicks a link which pops up a modal window with @RequireHttps annotation on it. This is when the modal window shows an error saying that page cannot be found in the page map. We continue working with the hosting company, but we would appreciate any thoughts on this. Thanks, Alec On Sat, Apr 30, 2011 at 6:16 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: one does not need to copy cookies because browsers retain them across requests. -igor On Sat, Apr 30, 2011 at 5:01 PM, Alec Swan alecs...@gmail.com wrote: Hello, I tried copying all cookies from the HTTP request to HTTP response and it seemed to have a positive effect (unless our hosting company fixed something on their load balancer). However, I would expect Wicket to copy cookies from request to response by default, is this true? Here is the code I added trying to fix the problem with the load balancer cookie being lost: // copy all cookies from parent page to modal window in order to support sticky sessions on load balancer Cookie[] cookies = ((WebRequest) getRequestCycle().getRequest()).getCookies(); for (Cookie cookie : cookies) { ((WebResponse) getRequestCycle().getResponse()).addCookie(cookie); } Thanks, Alec On Fri, Apr 29, 2011 at 4:17 PM, Alec Swan alecs...@gmail.com wrote: Hello, We just put our webapp behind a load balancer with sticky sessions. After that we started noticing that load balancer cookie gets lost when a modal window is popped up by a link click. Here is the code we use to display the modal window: new AjaxLink(editLink) { @Override public void onClick(AjaxRequestTarget target) { modalWindow.setPageCreator(new ModalWindow.PageCreator() { @Override public Page createPage() { } } }); How can we make sure that cookies get preserved when we pop up a modal window? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands,
Re: Load balancer cookie is lost in modal window
or just put @requireshttps on your base page -igor On Sat, Apr 30, 2011 at 6:49 PM, Alec Swan alecs...@gmail.com wrote: Thank you for the great hint! It seems like a lot of people have a problem JSESSIONID cookie being lost by Tomcat when switching from HTTPS to HTTP. We are switching in the opposite direction, but I assume the could be problematic as well. At this point we are willing to force HTTPS for the entire webapp in order to avoid this problem. What's the recommended way to force all requests to go over HTTPS in production and go over HTTP in development? Should we use transport-guaranteeCONFIDENTIAL/transport-guarantee in web.xml and also override protected IRequestCycleProcessor newRequestCycleProcessor() as explained here: https://cwiki.apache.org/WICKET/how-to-switch-to-ssl-mode.html Thanks, Alec On Sat, Apr 30, 2011 at 7:10 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: this is because cookies created in http are not transferred to https and viceversa afair. i think this can be changed by turning off secure cookies in tomcat or something like that. -igor On Sat, Apr 30, 2011 at 6:06 PM, Alec Swan alecs...@gmail.com wrote: Even if the next request is made from inside an IFrame? If so, is this problem definitely a problem with the load balancer setup? Our hosting company ran HTTP trace and said this: Customer connects to the cluster via HTTP, in this case they are routed to web2. This packet passes through the load balancer, where a cookie is added by the LB. It adds a cookie to every packet that comes back from the server, so that the next connection goes to the same server. In the next request from the client to the server, we see both cookies in place. This continues on normally for a while with all packet headers containing the Cookies above. web1 suddenly gets a request for https, that does not contain any cookies, this has to be a new connection, there are no LB or JSESSION Cookies in these packets. Then, the next request goes back to web2 at this point we know we're going to get an error, after the above happens. What happens is that the user is browsing the web site and then clicks a link which pops up a modal window with @RequireHttps annotation on it. This is when the modal window shows an error saying that page cannot be found in the page map. We continue working with the hosting company, but we would appreciate any thoughts on this. Thanks, Alec On Sat, Apr 30, 2011 at 6:16 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: one does not need to copy cookies because browsers retain them across requests. -igor On Sat, Apr 30, 2011 at 5:01 PM, Alec Swan alecs...@gmail.com wrote: Hello, I tried copying all cookies from the HTTP request to HTTP response and it seemed to have a positive effect (unless our hosting company fixed something on their load balancer). However, I would expect Wicket to copy cookies from request to response by default, is this true? Here is the code I added trying to fix the problem with the load balancer cookie being lost: // copy all cookies from parent page to modal window in order to support sticky sessions on load balancer Cookie[] cookies = ((WebRequest) getRequestCycle().getRequest()).getCookies(); for (Cookie cookie : cookies) { ((WebResponse) getRequestCycle().getResponse()).addCookie(cookie); } Thanks, Alec On Fri, Apr 29, 2011 at 4:17 PM, Alec Swan alecs...@gmail.com wrote: Hello, We just put our webapp behind a load balancer with sticky sessions. After that we started noticing that load balancer cookie gets lost when a modal window is popped up by a link click. Here is the code we use to display the modal window: new AjaxLink(editLink) { @Override public void onClick(AjaxRequestTarget target) { modalWindow.setPageCreator(new ModalWindow.PageCreator() { @Override public Page createPage() { } } }); How can we make sure that cookies get preserved when we pop up a modal window? Thanks, Alec - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org