Re: Help us release 1.4 sooner by helping out with the migration guide
I have just migrated 33 very small projects I use in a basic Wicket course and everything went fine. Everything I had to change was already covered by the current migration guide. -- Cristiano 2009/7/10 Igor Vaynberg igor.vaynb...@gmail.com: We would like to release Wicket 1.4 very soon, but in order to do so we would like to provide our users with a good migration guide. We have started one here: http://cwiki.apache.org/confluence/display/WICKET/Migrate-1.4 but it probably lacks the smaller tweaks necessary to migrate. If you have recently migrated a project, or remember any changes you had to perform, or have any helpful tips or hints please add them to the migration guide. Do not worry about formatting, for now we are looking for content. If you do not want to bother putting them on the wiki simply add them to this thread. Thanks! -igor - 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: jetty prob
Review the parameter applicationClassName of the wicket mapping in your web.xml: Caused by: java.lang.ClassNotFoundException: servlet.UmfragesystemApp -- Cristiano On Sun, Mar 29, 2009 at 10:27 AM, Andreas Kaluza kal...@rhrk.uni-kl.dewrote: Hi @ all, I have renamed the package of my wicket-application. Now I cannot start the jetty server. The exception is: ERROR - log- failed wicket.Umfragesystem org.apache.wicket.WicketRuntimeException: Unable to create application of class servlet.UmfragesystemApp at org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.createAppl ication(ContextParamWebApplicationFactory.java:82) at org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.createAppl ication(ContextParamWebApplicationFactory.java:49) at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:551) at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:99) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:594) at org.mortbay.jetty.servlet.Context.startContext(Context.java:139) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.jetty.Server.doStart(Server.java:220) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at menerva.Start.main(Start.java:35) Caused by: java.lang.ClassNotFoundException: servlet.UmfragesystemApp at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java: 375) at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java: 337) at org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.createAppl ication(ContextParamWebApplicationFactory.java:68) ... 14 more ERROR - log- Failed startup of context org.mortbay.jetty.webapp.webappcont...@129f3b5{/,src/main/webapp} org.apache.wicket.WicketRuntimeException: Unable to create application of class servlet.UmfragesystemApp at org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.createAppl ication(ContextParamWebApplicationFactory.java:82) at org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.createAppl ication(ContextParamWebApplicationFactory.java:49) at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:551) at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:99) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:594) at org.mortbay.jetty.servlet.Context.startContext(Context.java:139) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.jetty.Server.doStart(Server.java:220) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at menerva.Start.main(Start.java:35) Caused by: java.lang.ClassNotFoundException: servlet.UmfragesystemApp at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java: 375) at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java: 337) at org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.createAppl ication(ContextParamWebApplicationFactory.java:68) ... 14 more WARN - log
Re: jetty prob
I forget it all the time. :-) On Sun, Mar 29, 2009 at 11:31 AM, Andreas Kaluza kal...@rhrk.uni-kl.dewrote: Thanks a lot! I forgot to change it in the web.xml... Damn it ;) -Ursprüngliche Nachricht- Von: Cristiano Kliemann [mailto:cristia...@gmail.com] Gesendet: Sonntag, 29. März 2009 16:14 An: users@wicket.apache.org Betreff: Re: jetty prob Review the parameter applicationClassName of the wicket mapping in your web.xml: Caused by: java.lang.ClassNotFoundException: servlet.UmfragesystemApp -- Cristiano On Sun, Mar 29, 2009 at 10:27 AM, Andreas Kaluza kal...@rhrk.uni- kl.dewrote: Hi @ all, I have renamed the package of my wicket-application. Now I cannot start the jetty server. The exception is: ERROR - log- failed wicket.Umfragesystem org.apache.wicket.WicketRuntimeException: Unable to create application of class servlet.UmfragesystemApp at org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.creat eAppl ication(ContextParamWebApplicationFactory.java:82) at org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.creat eAppl ication(ContextParamWebApplicationFactory.java:49) at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:551 ) at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:99) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40 ) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java :594) at org.mortbay.jetty.servlet.Context.startContext(Context.java:139) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java: 1218) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:50 0) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40 ) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:11 7) at org.mortbay.jetty.Server.doStart(Server.java:220) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40 ) at menerva.Start.main(Start.java:35) Caused by: java.lang.ClassNotFoundException: servlet.UmfragesystemApp at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader. java: 375) at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader. java: 337) at org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.creat eAppl ication(ContextParamWebApplicationFactory.java:68) ... 14 more ERROR - log- Failed startup of context org.mortbay.jetty.webapp.webappcont...@129f3b5{/,src/main/webapp} org.apache.wicket.WicketRuntimeException: Unable to create application of class servlet.UmfragesystemApp at org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.creat eAppl ication(ContextParamWebApplicationFactory.java:82) at org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.creat eAppl ication(ContextParamWebApplicationFactory.java:49) at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:551 ) at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:99) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40 ) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java :594) at org.mortbay.jetty.servlet.Context.startContext(Context.java:139) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java: 1218) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:50 0) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40 ) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:11 7) at org.mortbay.jetty.Server.doStart(Server.java:220) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40 ) at menerva.Start.main(Start.java:35
Re: Managing Pagemaps
Subbu, Also, when the session of the first application expires, the pagemap is automatically deleted. So, you'll only have to wait a few minutes and Wicket will do the job for you. -- Cristiano On Sat, Mar 14, 2009 at 3:38 AM, Martijn Dashorst martijn.dasho...@gmail.com wrote: Premature optimization. Don't try to do this type of stuff unless it is actually a problem. Why not make sure you have applications first and then see if it is actually a problem? Martijn On Sat, Mar 14, 2009 at 2:40 AM, subbu_tce subramanian.mur...@gmail.com wrote: I mean two different wicket applications running in the same JVM.. And i launch the first wicket application in a window.. i navigate among different pages in the first wicket application. now since i have navigated through different pages, i understand that multiple versions of the pages would have been maintained in page maps. Now i navigate to the second wicket application from the first wicket application. From the second wicket application, i might never navigate back to the first wicket application. so i would need to clean up everything that would be maintained in session with respect to the first wicket application when i navigate to the second application. thatz y i was wondering whether any hooks are there for the same. Johan Compagner wrote: do you mean multiply wicket applications on the same host? (just like our example?) then yes you have a pagemap set per wicket app in your session (prefixed with the wicket app name) There are no such hooks because a wicket app 1 is independent on wicket app 2, they should be isolated. (they could be in 1 context like exampels but also could be under different contexts) Why do you want to clean up pagemaps.. A pagemap only holds they active page and nothing more. What you can do is destroy the session on a logout button, but i guess you cant invalidate the http session if it is shared over multiply apps... johan On Fri, Mar 13, 2009 at 00:58, subbu_tce subramanian.mur...@gmail.comwrote: I understand that wicket maintains page maps by windows / tabs opened. If the user navigates to pages in multiple wicket applications in the same window, how are the page maps maintained? Will a new page map be created / maintained for every wicket application navigated in the same window? And does wicket provide any hook points to clean up page maps when a user navigates to different applications with in the same window? Thanks, Subbu. -- View this message in context: http://www.nabble.com/Managing-Pagemaps-tp22487669p22487669.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 -- View this message in context: http://www.nabble.com/Managing-Pagemaps-tp22487669p22508300.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 -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Is this a bug in Wicket?
Where is the 'conditionChoice' in the markup? On Thu, Mar 5, 2009 at 2:15 PM, rjilani jil...@lifebiosystems.com wrote: Hi: Gurus, I am trying to render a form and looks like wicket is not rendering the form elements in right sequence, here is my markup that is having the issues tr tdSearch feed by name:/td tdinput type=text wicket:id=feedName//td /tr tr tdinput type=radio / Match all conditions/td tdinput type=radio / Match any conditions/td tdinput type=radio / Match all news /td /tr here is the java code add(new TextField(feedName, new Model())); add(new RadioChoice(conditionChoice, new Model(),conditionChoices ).setSuffix()); when I run the code I see the radio button choices before the text field; any suggestions? Thanks, RJ. -- View this message in context: http://www.nabble.com/Is-this-a-bug-in-Wicket--tp22356116p22356116.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
Re: Propper Way to Format Money
I wouldn't recomend declaring it as float ou double. With floating point, sometimes 14.8 minus 13.76 is 1.041. Use BigDecimal. It is much safer. -- Cristiano On Wed, Feb 25, 2009 at 7:20 PM, Daniel Ferreira Castro dfcas...@gmail.comwrote: I would like an opinion about what is the propper, or more recommended, way to format a TextField to show money? Should I declare it TextFieldString or TextFieldFloat? And to format it with the money symbol ( Like US$) while you type? Any ideas? -- Two rules to succeed in life: 1 - don´t tell people everything you know. We shall go on to the end. We shall fight in France We shall fightover the seas and oceans. We shall fight with growing confidence and growing strength in the air. We shall defend our island whatever the cost may be We shall fight on beaches, we shall fight on the landing grounds, We shall fight in the fields and in the streets, We shall fight on the hills. We shall never surrender. Winston Churchill
Re: how to hide parameter in URL? for parameters
wch, Why do you need to make a bookmarkable page and hide its parameters? It doesn't make much sense to me. The main purpose of bookmarkable pages is, like the name says, to let the user bookmark them (by copying to a text file, for example) with all the parameters needed to show what you intend to show. You can't just hide the parameters with a bookmarkable page. To completely hide them, the only choice is to use a post request. You can, however, obfuscate them with a URL coding strategy, like Jeremy said. You may use IndexedParamUrlCodingStrategy or implement your own. -- Cristiano On Thu, Feb 19, 2009 at 2:31 PM, Jeremy Thomerson jer...@wickettraining.com wrote: A post isn't always the answer, obviously, if you need a bookmarkable page. Look at the IndexedParamUrlCodingStrategy - that's what you need. -- Jeremy Thomerson http://www.wickettraining.com On Thu, Feb 19, 2009 at 3:12 AM, taha siddiqi tawushaf...@gmail.com wrote: use a post request !! tawus On Thu, Feb 19, 2009 at 2:31 PM, wch2001 wch2...@hotmail.com wrote: Dear all, I am doing a project , there is one url with some parameters as below http://localhost:8080/dira/?wicket:bookmarkablePage=%3Asg.sphsearch.dira.web.wicket.pages.company.CompanyDetailoriginPage=companyorganizationId=191834 If I set mountBookmarkablePage in webApplication for CompanyDetail like that: mountBookmarkablePage(/company, CompanyDetail.class); The url will be changed to http://localhost:8080/dira/company/originPage/company/organizationId/191834/ how Can I hide the parameters? like http://localhost:8080/dira/company thanks wch -- View this message in context: http://www.nabble.com/how-to-hide-parameter-in-URL--for-parameters-tp22096367p22096367.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to handle this exception properly
The problem is that you are calling getResponse().getOutputStream(), which invokes getOutputSteam from the http servlet response. After handling your request, Wicket calls getWriter from the same response. From the ServletResponse.getOutputStream Javadoc: Either this method or getWritereclipse-javadoc:%E2%98%82=lpscad/C:%5C/Documents%20and%20Settings%5C/deinf.crk%5C/.m2%5C/repository%5C/javax%5C/servlet%5C/servlet-api%5C/2.5%5C/servlet-api-2.5.jar%3Cjavax.servlet%28ServletResponse.class%E2%98%83ServletResponse%7EgetOutputStream%E2%98%82%E2%98%82getWritermay be called to write the body, not both. Throws:IllegalStateExceptioneclipse-javadoc:%E2%98%82=lpscad/C:%5C/Documents%20and%20Settings%5C/deinf.crk%5C/.m2%5C/repository%5C/javax%5C/servlet%5C/servlet-api%5C/2.5%5C/servlet-api-2.5.jar%3Cjavax.servlet%28ServletResponse.class%E2%98%83ServletResponse%7EgetOutputStream%E2%98%82IllegalStateException- if the getWriter method has been called on this response So, Wicket can't render the error page. -- Cristiano On Tue, Feb 10, 2009 at 5:57 AM, Anton Veretennikov anton.veretenni...@gmail.com wrote: Hello, all wicket users! I receive HTTP Status 500 error in this situation: I have a page with empty html-file and page's onRender() looks like: OutputStreamWriter writer = null; try { writer = new OutputStreamWriter(getResponse().getOutputStream(), encoding); String enc = getRequestCycle().getResponse().getCharacterEncoding(); writer.append(!-- + enc + --\n); writer.append(.); } catch (UnsupportedEncodingException ex) { throw new WicketRuntimeException(Invalid charset: + ex.getMessage()); } catch (IOException ex) { throw new WicketRuntimeException(IOException: + ex.getMessage()); } finally { if (writer != null) { try { writer.close(); } catch (IOException ex) { } } } The problem is when this first catch is reached (because encoding desired is sent as a parameter that could be errouneous) and new WicketRuntimeException(Invalid charset: + ex.getMessage()); is thrown I see HTTP Status 500 error with this: ERROR - WicketFilter - closing the buffer error java.lang.IllegalStateException: getOutputStream() has already been called for this response at org.apache.catalina.connector.Response.getWriter(Response.java:610) at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:198) at org.apache.wicket.protocol.http.WebResponse.write(WebResponse.java:365) at org.apache.wicket.protocol.http.BufferedWebResponse.close(BufferedWebResponse.java:73) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:471) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:288) I would like to know is it proper to throw WicketRuntimeException in such situation. For example I want to show standart Wicket Error page. Thank you very much. -- Tony - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [OT] wicket users around the world
Brasilia, Brazil On Thu, Dec 11, 2008 at 4:57 PM, francisco treacy francisco.tre...@gmail.com wrote: to know a little bit more of our great (and vast) community, i was just wondering if you're keen on sharing where you come from and/or where you work with wicket... for instance, here argentinian/belgian working with wicket in antibes, france francisco - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Memory consumption per session
Martin, There's no xml dom generator. Instead, Wicket uses a simple stream. In the rendering phase, you can execute getResponse().write(...) to write anything to the browser. --Cristiano On Thu, Nov 20, 2008 at 2:11 PM, Martin Makundi [EMAIL PROTECTED] wrote: What is the out-of-the-box xml dom generator for wicket, if I wanted to use such tool for generating the html structure? ** Martin 2008/11/20 Martijn Dashorst [EMAIL PROTECTED]: add(new Label(raw, h1Foo/h1).setEscapeModelStrings(false)); On Thu, Nov 20, 2008 at 5:00 PM, Martin Makundi [EMAIL PROTECTED] wrote: What is the easiest way of embedding raw html (yes, it could/should use some xml dom which is included with wicket)? Is it possible, for example, to replace a wicket:container/ element on a panel with such raw dom content? ** Martin 2008/11/20 Igor Vaynberg [EMAIL PROTECTED]: if you are planning on displaying 1000 rows per page, which is quiet uncommon for webapps, you should produce output as raw html instead of using listview and adding components inside. -igor On Thu, Nov 20, 2008 at 7:15 AM, Ralf Siemon [EMAIL PROTECTED] wrote: Hi, we have recently launched our new Wicket-based website, and now we are experiencing that the memory consumption of the website is very high, so that it crashes the site regularly. When profiling the application server, we found out that there are HTTP sessions that consume up to 2 MB of memory, mostly because there are very large ListViews with up to 1000 entries, where each entry consumes about 2 KB. Our preliminary solution is to limit the size of those ListViews to a maximum of 50 entries, but even in those cases the session size is still at about 200 KB, which seems quite large to us. I know that there have already been some discussions about memory consumption in Wicket due to the fact that the whole Page object of the last visited page is stored in the session; but what I'd like to know is: Have you experienced session sizes in a comparable magnitude, or are we doing something wrong? Or is this something we have to live with when using Wicket? We are using Wicket 1.3.5. Thanks, Ralf. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.4 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - 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]
Re: Memory consumption per session
Ralf, If you want to discard the generated text after rendering, you may use a detachable model, like LoadableDetachableModel: IModel model = new LoadableDetachableModel() { public Object load() { return generateMyHTML(); } } add(new Label(raw, model).setEscapeModelStrings(false)); Assigning the text directly to the label (as in Label(raw, h1Foo/h1)) will keep a reference to the String 'forever'. It's ok when the HTML is short, but it doesn't seem to be your case. --Cristiano On Thu, Nov 20, 2008 at 2:08 PM, Martijn Dashorst [EMAIL PROTECTED] wrote: add(new Label(raw, h1Foo/h1).setEscapeModelStrings(false)); On Thu, Nov 20, 2008 at 5:00 PM, Martin Makundi [EMAIL PROTECTED] wrote: What is the easiest way of embedding raw html (yes, it could/should use some xml dom which is included with wicket)? Is it possible, for example, to replace a wicket:container/ element on a panel with such raw dom content? ** Martin 2008/11/20 Igor Vaynberg [EMAIL PROTECTED]: if you are planning on displaying 1000 rows per page, which is quiet uncommon for webapps, you should produce output as raw html instead of using listview and adding components inside. -igor On Thu, Nov 20, 2008 at 7:15 AM, Ralf Siemon [EMAIL PROTECTED] wrote: Hi, we have recently launched our new Wicket-based website, and now we are experiencing that the memory consumption of the website is very high, so that it crashes the site regularly. When profiling the application server, we found out that there are HTTP sessions that consume up to 2 MB of memory, mostly because there are very large ListViews with up to 1000 entries, where each entry consumes about 2 KB. Our preliminary solution is to limit the size of those ListViews to a maximum of 50 entries, but even in those cases the session size is still at about 200 KB, which seems quite large to us. I know that there have already been some discussions about memory consumption in Wicket due to the fact that the whole Page object of the last visited page is stored in the session; but what I'd like to know is: Have you experienced session sizes in a comparable magnitude, or are we doing something wrong? Or is this something we have to live with when using Wicket? We are using Wicket 1.3.5. Thanks, Ralf. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.4 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page references and serialization
Tested with 1.3.2, 1.3.3, 1.3.4, 1.3.5 and 1.4-rc1 with the exact same results. With 1.3.0 and 1.3.1, it goes to 89KB instead of 64KB. Is it really an unexpected behavior? If a PageB holds a reference to PageA, it can change PageA state. The serialized version has an old, invalid state then. When someone, later, retrieves that instance (page map/page id/version) from the page store, Wicket must return the most actual state, the state serialized together with PageB, right? -Cristiano 2008/11/14 Matej Knopp [EMAIL PROTECTED] That would be a bug then. What wicket version are you using? -Matej On Fri, Nov 14, 2008 at 4:11 PM, Cristiano Kliemann [EMAIL PROTECTED] wrote: Martijn, I'm pretty sure it is serializing PageA again. I've put some breakpoints to confirm it (at DiskPageStore.PageSavingThread.run()). Also, the growt rate of the page store indicates that. The test I've run: PageA has one simple link (to do some stuff and go to PageB) and a byte array with 25KB. PageB has another link (to go back to PageA instance), the reference to PageA and a byte array of 10KB. After PageA is first serialized, the page store goes from nothing to about 27KB. When PageB is serialized, it goes to about 64KB, a 37KB difference. Testing the same thing but letting the reference to PageA null makes a lot of difference. When PageB is serialized, the page strore it grows from 27KB to just 38KB (a 11KB difference). -Cristiano 2008/11/14 Martijn Dashorst [EMAIL PROTECTED] iirc Wicket serialization is smart enough to discover that PageA should not be serialized as part of PageB, but instead will replace it with a reference to PageA's serialized instance. Martijn On Fri, Nov 14, 2008 at 7:15 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: if you are using 1.4rc1 there is no need to pass page references anymore. see Page#getPageId() and requestcycle.urlfor(pageid) -igor On Thu, Nov 13, 2008 at 6:20 PM, Cristiano Kliemann [EMAIL PROTECTED] wrote: Hi! Some questions about Wicket serialization... Let's say I have two pages, A and B, and page B holds a reference to page A. First, an instance of page A is rendered and gets serialized by Wicket. Then the user clicks on a button that creates an instance of page B, sets a reference to the current page A and executes setCurrentPage using page B as the response page, like the following: PageB b = new PageB(); b.setPageA(this); setResponsePage(b); The first question is: when the page B gets serialized, Wicket serializes the instance of page A again, right? If several of my pages need to hold references to other pages, the page store gets very big. I know that Wicket must serialize the same instance again because one of its attributes might have been changed. In my application, sometimes I need to hold references to the page that originated certain operations. Later, the user has the option to go back to that page. The 'problem' is that the originated page gets serialized all the time, and I don't need that. It gets worse when I have a chain of references. So, another question is: what's the best way to reference another page without serializing it again? I know I can hold the page's page map, id and version and get the instance on demand. Is it a good solution? Is there someting ready for that? Thanks Cristiano - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.4 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - 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]
Page references and serialization
Hi! Some questions about Wicket serialization... Let's say I have two pages, A and B, and page B holds a reference to page A. First, an instance of page A is rendered and gets serialized by Wicket. Then the user clicks on a button that creates an instance of page B, sets a reference to the current page A and executes setCurrentPage using page B as the response page, like the following: PageB b = new PageB(); b.setPageA(this); setResponsePage(b); The first question is: when the page B gets serialized, Wicket serializes the instance of page A again, right? If several of my pages need to hold references to other pages, the page store gets very big. I know that Wicket must serialize the same instance again because one of its attributes might have been changed. In my application, sometimes I need to hold references to the page that originated certain operations. Later, the user has the option to go back to that page. The 'problem' is that the originated page gets serialized all the time, and I don't need that. It gets worse when I have a chain of references. So, another question is: what's the best way to reference another page without serializing it again? I know I can hold the page's page map, id and version and get the instance on demand. Is it a good solution? Is there someting ready for that? Thanks Cristiano
Re: Exception redirecting to source page
Thanks for the reply. I think I will not use onRuntimeException to control my 'business exceptions' even if it works now. If Wicket doesn't count on such thing, I have no guarantee that it won't break in the future. I'm not sure it will not break in the future. What I'm afraid of changes in the Wicket code in future versions that could break my igor.vaynberg wrote: good. there are some internals that do not count on a runtime exception being thrown because of user code...for example throwing it out of something like validator will abort entire form processing, and might leave that particular form component in an inconsistent state. but throwing it out of onclick/onsubmit handlers shouldnt pose much problem as most wicket processing has already happened. -igor On Feb 18, 2008 8:40 AM, Cristiano Kliemann [EMAIL PROTECTED] wrote: Igor, It seems to work with Link.onClick also. Cristiano Kliemann wrote: Yes, it works, at least when the exception is thrown in Button.onSubmit. I haven't tried with Link.onClick. igor.vaynberg wrote: have you tried it and does it work? -igor On Feb 15, 2008 1:17 PM, Cristiano Kliemann [EMAIL PROTECTED] wrote: Hi! I have some business runtime exceptions that I want to be automatically catched and its message rendered in the same page that threw it instead of redirecting to an error page. Is there a safe way to do that? These 'business exceptions' are usually thrown in some specific methods like onSubmit and onClick. Extending the specific components is not an option for me. I did something I think it dangerous. Something like: public Page onRuntimeException(Page page, RuntimeException e) { Throwable current = e; while (current != null !(current instanceof MyBusinessException)) { current = current.getCause(); } if (current != null) { // MyBusinessException detected page.error(Error: + current.getMessage()); return page; } else { return super.onRuntimeException(page, e); } } When as exception is thrown, all the execution flow breaks, making some things not happen. The question is: is the above code safe assuming that MyException could be thrown only by methods like onSubmit and onClick? -- View this message in context: http://www.nabble.com/Exception-redirecting-to-source-page-tp15510198p15510198.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/Exception-redirecting-to-source-page-tp15510198p15547028.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/Exception-redirecting-to-source-page-tp15510198p15560807.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: Exception redirecting to source page
I spent some time editing the previous e-mail and forgot to delete the 'garbage' before posting... sorry :) igor.vaynberg wrote: good. there are some internals that do not count on a runtime exception being thrown because of user code...for example throwing it out of something like validator will abort entire form processing, and might leave that particular form component in an inconsistent state. but throwing it out of onclick/onsubmit handlers shouldnt pose much problem as most wicket processing has already happened. -igor On Feb 18, 2008 8:40 AM, Cristiano Kliemann [EMAIL PROTECTED] wrote: Igor, It seems to work with Link.onClick also. Cristiano Kliemann wrote: Yes, it works, at least when the exception is thrown in Button.onSubmit. I haven't tried with Link.onClick. igor.vaynberg wrote: have you tried it and does it work? -igor On Feb 15, 2008 1:17 PM, Cristiano Kliemann [EMAIL PROTECTED] wrote: Hi! I have some business runtime exceptions that I want to be automatically catched and its message rendered in the same page that threw it instead of redirecting to an error page. Is there a safe way to do that? These 'business exceptions' are usually thrown in some specific methods like onSubmit and onClick. Extending the specific components is not an option for me. I did something I think it dangerous. Something like: public Page onRuntimeException(Page page, RuntimeException e) { Throwable current = e; while (current != null !(current instanceof MyBusinessException)) { current = current.getCause(); } if (current != null) { // MyBusinessException detected page.error(Error: + current.getMessage()); return page; } else { return super.onRuntimeException(page, e); } } When as exception is thrown, all the execution flow breaks, making some things not happen. The question is: is the above code safe assuming that MyException could be thrown only by methods like onSubmit and onClick? -- View this message in context: http://www.nabble.com/Exception-redirecting-to-source-page-tp15510198p15510198.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/Exception-redirecting-to-source-page-tp15510198p15547028.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/Exception-redirecting-to-source-page-tp15510198p15561407.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: Exception redirecting to source page
I missed the generic exception 'goalkeeper' that JSF, Struts and other web frameworks have (I think). Alex Jacoby-2 wrote: Just wondering if this sort of thing is documented anywhere... Thanks, Alex On Feb 18, 2008, at 1:02 PM, Igor Vaynberg wrote: good. there are some internals that do not count on a runtime exception being thrown because of user code...for example throwing it out of something like validator will abort entire form processing, and might leave that particular form component in an inconsistent state. but throwing it out of onclick/onsubmit handlers shouldnt pose much problem as most wicket processing has already happened. -igor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Exception-redirecting-to-source-page-tp15510198p15581199.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: Exception redirecting to source page
Igor, It seems to work with Link.onClick also. Cristiano Kliemann wrote: Yes, it works, at least when the exception is thrown in Button.onSubmit. I haven't tried with Link.onClick. igor.vaynberg wrote: have you tried it and does it work? -igor On Feb 15, 2008 1:17 PM, Cristiano Kliemann [EMAIL PROTECTED] wrote: Hi! I have some business runtime exceptions that I want to be automatically catched and its message rendered in the same page that threw it instead of redirecting to an error page. Is there a safe way to do that? These 'business exceptions' are usually thrown in some specific methods like onSubmit and onClick. Extending the specific components is not an option for me. I did something I think it dangerous. Something like: public Page onRuntimeException(Page page, RuntimeException e) { Throwable current = e; while (current != null !(current instanceof MyBusinessException)) { current = current.getCause(); } if (current != null) { // MyBusinessException detected page.error(Error: + current.getMessage()); return page; } else { return super.onRuntimeException(page, e); } } When as exception is thrown, all the execution flow breaks, making some things not happen. The question is: is the above code safe assuming that MyException could be thrown only by methods like onSubmit and onClick? -- View this message in context: http://www.nabble.com/Exception-redirecting-to-source-page-tp15510198p15510198.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/Exception-redirecting-to-source-page-tp15510198p15547028.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: Exception redirecting to source page
Yes, it works, at least when the exception is thrown in Button.onSubmit. I haven't tried with Link.onClick. igor.vaynberg wrote: have you tried it and does it work? -igor On Feb 15, 2008 1:17 PM, Cristiano Kliemann [EMAIL PROTECTED] wrote: Hi! I have some business runtime exceptions that I want to be automatically catched and its message rendered in the same page that threw it instead of redirecting to an error page. Is there a safe way to do that? These 'business exceptions' are usually thrown in some specific methods like onSubmit and onClick. Extending the specific components is not an option for me. I did something I think it dangerous. Something like: public Page onRuntimeException(Page page, RuntimeException e) { Throwable current = e; while (current != null !(current instanceof MyBusinessException)) { current = current.getCause(); } if (current != null) { // MyBusinessException detected page.error(Error: + current.getMessage()); return page; } else { return super.onRuntimeException(page, e); } } When as exception is thrown, all the execution flow breaks, making some things not happen. The question is: is the above code safe assuming that MyException could be thrown only by methods like onSubmit and onClick? -- View this message in context: http://www.nabble.com/Exception-redirecting-to-source-page-tp15510198p15510198.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/Exception-redirecting-to-source-page-tp15510198p15528633.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]
Exception redirecting to source page
Hi! I have some business runtime exceptions that I want to be automatically catched and its message rendered in the same page that threw it instead of redirecting to an error page. Is there a safe way to do that? These 'business exceptions' are usually thrown in some specific methods like onSubmit and onClick. Extending the specific components is not an option for me. I did something I think it dangerous. Something like: public Page onRuntimeException(Page page, RuntimeException e) { Throwable current = e; while (current != null !(current instanceof MyBusinessException)) { current = current.getCause(); } if (current != null) { // MyBusinessException detected page.error(Error: + current.getMessage()); return page; } else { return super.onRuntimeException(page, e); } } When as exception is thrown, all the execution flow breaks, making some things not happen. The question is: is the above code safe assuming that MyException could be thrown only by methods like onSubmit and onClick? -- View this message in context: http://www.nabble.com/Exception-redirecting-to-source-page-tp15510198p15510198.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]