Re: localization and session expiration
Thanks for your answers! It is quite good idea with cookies and header... Unfortunately it will not work if the user turns off cookies in his browser... but I think in this case he can thank himself for such inconvenience : BR, Elena. Anton Veretennikov wrote: If cookie is already set, get it and use, if no then set it as browser's getLocale() and save to cookie. To get cookies: Cookie[] cookies = ((WebRequest)getRequestCycle().getRequest()).getCookies(); if (cookies!=null) { for (int i = 0; i cookies.length; i++) { Cookie cookie = cookies[i]; ... } } To set cookie: Cookie cookie = new Cookie(language, selectedLanguage); cookie.setMaxAge(2678400); //31 день ((WebResponse) getRequestCycle().getResponse()).addCookie(cookie); -- Tony On Fri, Mar 6, 2009 at 7:26 PM, Jonas barney...@gmail.com wrote: No need to use spring for that, the locale of a WebSession is initialized from ServletRequest#getLocale() by default, which is based on the Accept-Language header. On Fri, Mar 6, 2009 at 12:57 PM, Leszek Gawron lgaw...@apache.org wrote: Anton Veretennikov wrote: May be cookie? You can also try to extract the locale used by user in the browser from request header: http://www.acegisecurity.org/guide/springsecurity.html#concurrent-sessions GET /guide/springsecurity.html HTTP/1.1 Host: www.acegisecurity.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: pl,en;q=0.7,en-us;q=0.3 ^ Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://www.acooke.org/cute/SessionLim0.html If-Modified-Since: Tue, 15 Apr 2008 17:18:26 GMT If-None-Match: 28002-5ba09-44aec96961c80 Cache-Control: max-age=0 HTTP/1.x 304 Not Modified Date: Fri, 06 Mar 2009 11:52:59 GMT Server: Apache/2.2.8 (EL) Connection: close Etag: 28002-5ba09-44aec96961c80 Spring can resolve locale for you in a flexible manner: http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/web/servlet/LocaleResolver.html in your case: http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/web/servlet/i18n/AcceptHeaderLocaleResolver.html To integrate wicket with spring in this context override WebApplication.newSession: @Override public Session newSession( Request request, Response response ) { return new WebSession( request ) { @Override public Locale getLocale() { return LocaleContextHolder.getLocale(); } }; } -- Leszek Gawron - 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 -- View this message in context: http://www.nabble.com/localization-and-session-expiration-tp22366384p22384529.html Sent from the Wicket - User 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
localization and session expiration
Hello! I have a question: in my application there are several locales and the user can choose locale on the fly. Locale is stored in the session and all is ok while the session exists. But! When the session is expired the application must say user about this and it does - using default locale. It is unpleasant - from the user's point of view the application changes locale by its own will. Is there any workaraound for such situation? The only thought that I have is to add locale parameter to every url but it is so ugly... Best regards, Elena. -- View this message in context: http://www.nabble.com/localization-and-session-expiration-tp22366384p22366384.html Sent from the Wicket - User 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
how to test multiple submits on the form
Hi, all! I have a question regarding the load testing of the Wicket application. I have used this article http://cwiki.apache.org/WICKET/multiple-submit-buttons.html to create the form in my application. All works well. But now I have to organize load testing of my application. I have read this article - http://cwiki.apache.org/WICKET/wicket-and-jmeter-with-regular-expressions.html began to write test plan and suddenly met the problem: I can't write regular expression to submit form to the server. It is easy when there is one submit button but what should I do if there are several of them? I don't know how to press one definite button. I think that the problem comes to following: I don't understand how Wicket does determine what button was pressed. When any submit button is pressed the url seems to be the same - something like this: http://host/applpath/?wicket:interface=:1:formName::IFormSubmitListener::. May be I'm wrong and didn't notice some important detail? Could anybody clear this situation for me? Best regards, Elena. -- View this message in context: http://www.nabble.com/how-to-test-multiple-submits-on-the-form-tp18921170p18921170.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: persistent sessions in Tomcat
Thanks, I tried to check this for wicket examples and it works with default server configuration. This means that there are some error in my application... but I haven't any error messages... ok, I'll continue experiments. Does that message page expired mean that the session is gone? So I have next question: default session timeout for Tomcat is 30 minutes but page expired appears much earlier - even for wicket examples. Why? Johan Compagner wrote: the default config of tomcat already restarts the wicket example sessions just fine for me I havent changed 1 thing about that On Tue, May 13, 2008 at 11:59 AM, ElSe [EMAIL PROTECTED] wrote: Do you mean tomcat logs? No I don't. Some *.ser files appear in the work\Catalina\localhost\application directory so session is serialized but isn't restored. Do I understand correctly that my assumption is correct and the wicket session must be restored with the tomcat persistent manager? So there must be some error in the configuration of the server or application itself? igor.vaynberg wrote: do you get any serialization errors in your logs, you might be trying to store something non serializable in the wicket component. -igor On Mon, May 12, 2008 at 1:09 AM, ElSe [EMAIL PROTECTED] wrote: Hi, I'm just started experiments with Wicket so I suppose my question is stupid however I haven't found the answer on the forum. The point was to understand how to organize persistent sessions for the wicket application. It seemed to me that such application should work with the standard Tomcat mechanism transparently as any other servlet. So I have written simple wicket application - just two pages that show sessionid, configured Tomcat persistent manager and started session. Then I restarted the server and tried to pass from one page to another waiting to see the same sessionid. But I have seen page has expired. Should I provide some serialization support in my application or there is some error in my logic or there aren't such possibility and I want something strange(c)? BR -- View this message in context: http://www.nabble.com/persistent-sessions-in-Tomcat-tp17183181p17183181.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/persistent-sessions-in-Tomcat-tp17183181p17205069.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/persistent-sessions-in-Tomcat-tp17183181p17226017.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: persistent sessions in Tomcat
Do you mean tomcat logs? No I don't. Some *.ser files appear in the work\Catalina\localhost\application directory so session is serialized but isn't restored. Do I understand correctly that my assumption is correct and the wicket session must be restored with the tomcat persistent manager? So there must be some error in the configuration of the server or application itself? igor.vaynberg wrote: do you get any serialization errors in your logs, you might be trying to store something non serializable in the wicket component. -igor On Mon, May 12, 2008 at 1:09 AM, ElSe [EMAIL PROTECTED] wrote: Hi, I'm just started experiments with Wicket so I suppose my question is stupid however I haven't found the answer on the forum. The point was to understand how to organize persistent sessions for the wicket application. It seemed to me that such application should work with the standard Tomcat mechanism transparently as any other servlet. So I have written simple wicket application - just two pages that show sessionid, configured Tomcat persistent manager and started session. Then I restarted the server and tried to pass from one page to another waiting to see the same sessionid. But I have seen page has expired. Should I provide some serialization support in my application or there is some error in my logic or there aren't such possibility and I want something strange(c)? BR -- View this message in context: http://www.nabble.com/persistent-sessions-in-Tomcat-tp17183181p17183181.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/persistent-sessions-in-Tomcat-tp17183181p17205069.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
persistent sessions in Tomcat
Hi, I'm just started experiments with Wicket so I suppose my question is stupid however I haven't found the answer on the forum. The point was to understand how to organize persistent sessions for the wicket application. It seemed to me that such application should work with the standard Tomcat mechanism transparently as any other servlet. So I have written simple wicket application - just two pages that show sessionid, configured Tomcat persistent manager and started session. Then I restarted the server and tried to pass from one page to another waiting to see the same sessionid. But I have seen page has expired. Should I provide some serialization support in my application or there is some error in my logic or there aren't such possibility and I want something strange(c)? BR -- View this message in context: http://www.nabble.com/persistent-sessions-in-Tomcat-tp17183181p17183181.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]