Re: [Wicket-user] error(...) No page found for component
About copy on write and session sync First copy: synching is a bit dangerous. Because just the methods of the copy on write synced wont help us because then the methods that access that messages should be synched (so the outside world) why? thread one iterates over the messages to display them in the mean time thread 2 comes and says: cleanup... bang concurrent modification exception.. second: session sync what we had won't help here. Because the session sync we had was inside the RequestCycle.step() (processandrespond) but that didn't help the feedback messages because the clearing of them happened outside that. Now we have a pagemap lock long before that (when first trying to resolve a page) and long after that its released with as one of the last things in RequestCycle.detach(): session.requestDetached(); We could set the barrier on the session instead of the pagemap. But that still wouldn't help us with shared resouces that access the session. So we won't gain much. but we do loose a bit of concurrency again. johan On 4/1/07, Eelco Hillenius [EMAIL PROTECTED] wrote: Do feedbackmessages in the session really need to be synchronized with CopyOnWriteArrayList? I'm in doubt whether synchronization helps that much, but if it does, wouldn't it be more efficient to use a normal synchronized one? Eelco On 3/31/07, Eelco Hillenius [EMAIL PROTECTED] wrote: On 3/31/07, Igor Vaynberg [EMAIL PROTECTED] wrote: i am not so sure this is correct. we often deal with two page instances inside the same request - the current one and the response page. this breaks any kind of scoping as errors reported against current page will now make it into response page? About the session messages... well, they have a slightly different meaning: display whenever there is a feedback component rendered on any page. This is useful when writing generic software where you know that a message should be displayed, but you just don't know the target (e.g. at the end of a wizard). About per-page or per-request... yeah, we've been there too. If we look back at the history we can say that the page is the correct place to have it. So, what we should do is put the messages for the pages in the session, and at the start of rendering (right before attach), iterate through those messages and the ones that have components attached (are for pages) are then added to those pages. If there are messages with components that are not coupled to a page, well tough luck and discard them (those would throw an exception currently). One final thing we should fix is the fact that feedbackmessages don't get cleaned up when there are no feedback components in the page. This is a memory leak. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] error(...) No page found for component
First copy: synching is a bit dangerous. Because just the methods of the copy on write synced wont help us because then the methods that access that messages should be synched (so the outside world) why? Yeah, it makes sense. I kept copy on write. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] error(...) No page found for component
copy on write has the advantage when it comes to iterating over the list. Only a real advantage when there would be many threads/ many reads, and adding is more expensive with this list. I would be surprised if this list gives a better performance. But we can benchmark it. Another disadvantage is that the Iterator of that list doesn't allow remove. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] error(...) No page found for component
well, we do a lot of iterations. anytime formcomponent.isvalid() is called we iterate over messages to see if there are any for that component. in my apps that is called a couple of times per formcomponent per request. i went with copyonwrite because the iterator isnt synced at all. we dont selectively remove messages anywhere, so iterator.remove() not being supported is not a big deal for me. but of course if you profile it and get a better performance with something else feel free to change it, i just went with whatever i thought was going to give the best performance without doing any testing. -igor On 3/31/07, Eelco Hillenius [EMAIL PROTECTED] wrote: copy on write has the advantage when it comes to iterating over the list. Only a real advantage when there would be many threads/ many reads, and adding is more expensive with this list. I would be surprised if this list gives a better performance. But we can benchmark it. Another disadvantage is that the Iterator of that list doesn't allow remove. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] error(...) No page found for component
well, we do a lot of iterations. anytime formcomponent.isvalid() is called we iterate over messages to see if there are any for that component. in my apps that is called a couple of times per formcomponent per request. i went with copyonwrite because the iterator isnt synced at all. Ok, maybe I underestimated the number of reads. Didn't do any testing either. we dont selectively remove messages anywhere, so iterator.remove() not being supported is not a big deal for me. We would if we go for the idea of having all messages in the session. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] error(...) No page found for component
You component is not attached to a parent yet. You could try doing that work in onAttach(). serban.balamaci wrote: Hi. I have a problem in that inside the constructor of a page(panel actually) i invoke a stored procedure which needs to get the model for the panel. The stored procedure may throw an error message. The error message should be seen by the user, he can understand what he did wrong. So inside the constructor i have something like this: public PanelConstructor() { try { invoke stored procedure . } catch(UserPresentableException e) { error(e.getMessage); } } The problem is that if the error is thrown i get a No page found for component. I understand that the cause of the error is that the error component not being instantiated because of the constructor not being finished(or i think that's the cause). Any ideas of solutions that i can implement? I know that i could set wicket to production instead of development and get rid of the stack trace. The problem is that i would like to keep the error message - to show the error message back to the user-. Should i instead of doing error(e.getMessage) rethrow the message inside a new defined exception and have a custom error page for that exception in which i would show only the message of the error. Is there any option that would keep me from treating the errors in the constructor other than how i treat an error from a button push in which i do error(e.getMessage())? Thanks. -- View this message in context: http://www.nabble.com/error%28...%29-No-page-found-for-component-tf3497125.html#a9768516 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] error(...) No page found for component
Weird problem. Can you give us a stack trace please? I tried this: Index: /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/helloworld/HelloWorld.java === --- /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/helloworld/HelloWorld.java (revision 524461) +++ /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/helloworld/HelloWorld.java (working copy) @@ -17,7 +17,7 @@ package wicket.examples.helloworld; import wicket.examples.WicketExamplePage; -import wicket.markup.html.basic.Label; +import wicket.markup.html.panel.FeedbackPanel; /** * Everybody's favorite example! @@ -31,6 +31,7 @@ */ public HelloWorld() { - add(new Label(message, Hello World!)); + error(test); + add(new FeedbackPanel(message)); } } \ No newline at end of file And that works fine... Eelco On 3/31/07, serban.balamaci [EMAIL PROTECTED] wrote: Hi. I have a problem in that inside the constructor of a page(panel actually) i invoke a stored procedure which needs to get the model for the panel. The stored procedure may throw an error message. The error message should be seen by the user, he can understand what he did wrong. So inside the constructor i have something like this: public PanelConstructor() { try { } catch(UserPresentableException e) { error(e.getMessage); } } The problem is that if the error is thrown i get a No page found for component. I understand that the cause of the error is that the error component not being instantiated because of the constructor not being finished(or i think that's the cause). Any ideas of solutions that i can implement? I know that i could set wicket to production instead of development and get rid of the stack trace. The problem is that i would like to keep the error message - to show the error message back to the user-. Should i instead of doing error(e.getMessage) rethrow the message inside a new defined exception and have a custom error page for that exception in which i would show only the message of the error. Is there any option that would keep me from treating the errors in the constructor other than how i treat an error from a button push? Thanks. -- View this message in context: http://www.nabble.com/error%28...%29-No-page-found-for-component-tf3497125.html#a9767935 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] error(...) No page found for component
it works fine because you are calling error on a page and not on a component. errors are stored at page-level. -igor On 3/31/07, Eelco Hillenius [EMAIL PROTECTED] wrote: Weird problem. Can you give us a stack trace please? I tried this: Index: /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.5 /wicket-examples/src/main/java/wicket/examples/helloworld/HelloWorld.java === --- /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.5 /wicket-examples/src/main/java/wicket/examples/helloworld/HelloWorld.java (revision 524461) +++ /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.5 /wicket-examples/src/main/java/wicket/examples/helloworld/HelloWorld.java (working copy) @@ -17,7 +17,7 @@ package wicket.examples.helloworld; import wicket.examples.WicketExamplePage; -import wicket.markup.html.basic.Label; +import wicket.markup.html.panel.FeedbackPanel; /** * Everybody's favorite example! @@ -31,6 +31,7 @@ */ public HelloWorld() { - add(new Label(message, Hello World!)); + error(test); + add(new FeedbackPanel(message)); } } \ No newline at end of file And that works fine... Eelco On 3/31/07, serban.balamaci [EMAIL PROTECTED] wrote: Hi. I have a problem in that inside the constructor of a page(panel actually) i invoke a stored procedure which needs to get the model for the panel. The stored procedure may throw an error message. The error message should be seen by the user, he can understand what he did wrong. So inside the constructor i have something like this: public PanelConstructor() { try { } catch(UserPresentableException e) { error(e.getMessage); } } The problem is that if the error is thrown i get a No page found for component. I understand that the cause of the error is that the error component not being instantiated because of the constructor not being finished(or i think that's the cause). Any ideas of solutions that i can implement? I know that i could set wicket to production instead of development and get rid of the stack trace. The problem is that i would like to keep the error message - to show the error message back to the user-. Should i instead of doing error(e.getMessage) rethrow the message inside a new defined exception and have a custom error page for that exception in which i would show only the message of the error. Is there any option that would keep me from treating the errors in the constructor other than how i treat an error from a button push? Thanks. -- View this message in context: http://www.nabble.com/error%28...%29-No-page-found-for-component-tf3497125.html#a9767935 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] error(...) No page found for component
Ok, I see. public final void error(final Serializable message) { getPage().getFeedbackMessages().error(this, message); } Why don't we fix this? Eelco On 3/31/07, Igor Vaynberg [EMAIL PROTECTED] wrote: it works fine because you are calling error on a page and not on a component. errors are stored at page-level. -igor On 3/31/07, Eelco Hillenius [EMAIL PROTECTED] wrote: Weird problem. Can you give us a stack trace please? I tried this: Index: /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/helloworld/HelloWorld.java === --- /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/helloworld/HelloWorld.java (revision 524461) +++ /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/helloworld/HelloWorld.java (working copy) @@ -17,7 +17,7 @@ package wicket.examples.helloworld ; import wicket.examples.WicketExamplePage; -import wicket.markup.html.basic.Label; +import wicket.markup.html.panel.FeedbackPanel; /** * Everybody's favorite example! @@ -31,6 +31,7 @@ */ public HelloWorld() { - add(new Label(message, Hello World!)); + error(test); + add(new FeedbackPanel(message)); } } \ No newline at end of file And that works fine... Eelco On 3/31/07, serban.balamaci [EMAIL PROTECTED] wrote: Hi. I have a problem in that inside the constructor of a page(panel actually) i invoke a stored procedure which needs to get the model for the panel. The stored procedure may throw an error message. The error message should be seen by the user, he can understand what he did wrong. So inside the constructor i have something like this: public PanelConstructor() { try { } catch(UserPresentableException e) { error(e.getMessage); } } The problem is that if the error is thrown i get a No page found for component. I understand that the cause of the error is that the error component not being instantiated because of the constructor not being finished(or i think that's the cause). Any ideas of solutions that i can implement? I know that i could set wicket to production instead of development and get rid of the stack trace. The problem is that i would like to keep the error message - to show the error message back to the user-. Should i instead of doing error(e.getMessage) rethrow the message inside a new defined exception and have a custom error page for that exception in which i would show only the message of the error. Is there any option that would keep me from treating the errors in the constructor other than how i treat an error from a button push? Thanks. -- View this message in context: http://www.nabble.com/error%28...%29-No-page-found-for-component-tf3497125.html#a9767935 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future
Re: [Wicket-user] error(...) No page found for component
Fix it like this: Index: /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java === --- /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java (revision 524461) +++ /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java (working copy) @@ -33,6 +33,7 @@ import wicket.authorization.UnauthorizedActionException; import wicket.behavior.IBehavior; import wicket.feedback.FeedbackMessage; +import wicket.feedback.FeedbackMessages; import wicket.markup.ComponentTag; import wicket.markup.MarkupException; import wicket.markup.MarkupStream; @@ -457,6 +458,8 @@ private static final int FLAG_ATTACHING = 0x4000; private static final int FLAG_DETACHING = 0x8000; + /** List of feedback messages to add. */ + private transient List feedbackMessages; /** Basic model IModelComparator implementation for normal object models */ private static final IModelComparator defaultModelComparator = new IModelComparator() @@ -662,7 +665,7 @@ */ public final void debug(final String message) { - getPage().getFeedbackMessages().debug(this, message); + add(new FeedbackMessage(this, message, FeedbackMessage.DEBUG)); } /** @@ -685,7 +688,7 @@ */ public final void error(final Serializable message) { - getPage().getFeedbackMessages().error(this, message); + add(new FeedbackMessage(this, message, FeedbackMessage.ERROR)); } /** @@ -696,7 +699,7 @@ */ public final void fatal(final String message) { - getPage().getFeedbackMessages().fatal(this, message); + add(new FeedbackMessage(this, message, FeedbackMessage.FATAL)); } /** @@ -1235,7 +1238,7 @@ */ public final void info(final String message) { - getPage().getFeedbackMessages().info(this, message); + add(new FeedbackMessage(this, message, FeedbackMessage.INFO)); } /** @@ -2376,7 +2379,7 @@ */ public final void warn(final String message) { - getPage().getFeedbackMessages().warn(this, message); + add(new FeedbackMessage(this, message, FeedbackMessage.WARNING)); } /** @@ -2734,6 +2737,7 @@ { setFlag(FLAG_ATTACHING, true); setFlag(FLAG_ATTACHED, true); + onAttach(); if (getFlag(FLAG_ATTACHING)) { @@ -3023,6 +3027,40 @@ } /** +* Called by the containing page to enable components to add their +* temporarily stored feedback messages to the messages instance of the +* page. +* +* @param msgs +*The feedback messages. Components can add messages to it +*/ + final void addFeedback(final FeedbackMessages msgs) + { + // add deferred messages if any + if (feedbackMessages != null) + { + for (Iterator i = feedbackMessages.iterator(); i.hasNext();) + { + msgs.add((FeedbackMessage)i.next()); + } + // reset + feedbackMessages = null; + } + if (this instanceof MarkupContainer) + { + MarkupContainer container = (MarkupContainer)this; + container.visitChildren(new IVisitor() + { + public Object component(Component component) + { + component.addFeedback(msgs); + return IVisitor.CONTINUE_TRAVERSAL; + } + }); + } + } + + /** * Gets the component at the given path. * * @param path @@ -3163,6 +3201,21 @@ } /** +* Adds a feedback message to be added to the page later. +* +* @param msg +*message +*/ + private final void add(FeedbackMessage msg) + { + if (feedbackMessages == null) + { + feedbackMessages = new ArrayList(); + } + feedbackMessages.add(msg); + } + + /** * Finds the root object for an IModel * * @param model Index:
Re: [Wicket-user] error(...) No page found for component
I don't like the addition of the 4 bytes to the component. Apparently the usecase is pretty rare (only discovered after 2 years of production use), and this will increase memory usage considerably for a small benefit. Isn't a message queue that isn't bound to a component but to the current thread, that registers the object that receives the feedback, and is queried at the end of the request to store any messages at the appropriate place? Martijn On 4/1/07, Eelco Hillenius [EMAIL PROTECTED] wrote: Fix it like this: Index: /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java === --- /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java (revision 524461) +++ /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java (working copy) @@ -33,6 +33,7 @@ import wicket.authorization.UnauthorizedActionException; import wicket.behavior.IBehavior; import wicket.feedback.FeedbackMessage; +import wicket.feedback.FeedbackMessages; import wicket.markup.ComponentTag; import wicket.markup.MarkupException; import wicket.markup.MarkupStream; @@ -457,6 +458,8 @@ private static final int FLAG_ATTACHING = 0x4000; private static final int FLAG_DETACHING = 0x8000; + /** List of feedback messages to add. */ + private transient List feedbackMessages; /** Basic model IModelComparator implementation for normal object models */ private static final IModelComparator defaultModelComparator = new IModelComparator() @@ -662,7 +665,7 @@ */ public final void debug(final String message) { - getPage().getFeedbackMessages().debug(this, message); + add(new FeedbackMessage(this, message, FeedbackMessage.DEBUG)); } /** @@ -685,7 +688,7 @@ */ public final void error(final Serializable message) { - getPage().getFeedbackMessages().error(this, message); + add(new FeedbackMessage(this, message, FeedbackMessage.ERROR)); } /** @@ -696,7 +699,7 @@ */ public final void fatal(final String message) { - getPage().getFeedbackMessages().fatal(this, message); + add(new FeedbackMessage(this, message, FeedbackMessage.FATAL)); } /** @@ -1235,7 +1238,7 @@ */ public final void info(final String message) { - getPage().getFeedbackMessages().info(this, message); + add(new FeedbackMessage(this, message, FeedbackMessage.INFO)); } /** @@ -2376,7 +2379,7 @@ */ public final void warn(final String message) { - getPage().getFeedbackMessages().warn(this, message); + add(new FeedbackMessage(this, message, FeedbackMessage.WARNING)); } /** @@ -2734,6 +2737,7 @@ { setFlag(FLAG_ATTACHING, true); setFlag(FLAG_ATTACHED, true); + onAttach(); if (getFlag(FLAG_ATTACHING)) { @@ -3023,6 +3027,40 @@ } /** +* Called by the containing page to enable components to add their +* temporarily stored feedback messages to the messages instance of the +* page. +* +* @param msgs +*The feedback messages. Components can add messages to it +*/ + final void addFeedback(final FeedbackMessages msgs) + { + // add deferred messages if any + if (feedbackMessages != null) + { + for (Iterator i = feedbackMessages.iterator(); i.hasNext();) + { + msgs.add((FeedbackMessage)i.next()); + } + // reset + feedbackMessages = null; + } + if (this instanceof MarkupContainer) + { + MarkupContainer container = (MarkupContainer)this; + container.visitChildren(new IVisitor() + { + public Object component(Component component) + { + component.addFeedback(msgs); + return IVisitor.CONTINUE_TRAVERSAL; + } + }); + } + } + + /** * Gets the component at the given path. * * @param path @@ -3163,6 +3201,21 @@
Re: [Wicket-user] error(...) No page found for component
Sure, sounds good. Can you make a proposal please? It's kind of where we started in the first versions, but then again, much was different and this time that can work. Eelco On 3/31/07, Martijn Dashorst [EMAIL PROTECTED] wrote: I don't like the addition of the 4 bytes to the component. Apparently the usecase is pretty rare (only discovered after 2 years of production use), and this will increase memory usage considerably for a small benefit. Isn't a message queue that isn't bound to a component but to the current thread, that registers the object that receives the feedback, and is queried at the end of the request to store any messages at the appropriate place? Martijn On 4/1/07, Eelco Hillenius [EMAIL PROTECTED] wrote: Fix it like this: Index: /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java === --- /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java (revision 524461) +++ /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java (working copy) @@ -33,6 +33,7 @@ import wicket.authorization.UnauthorizedActionException; import wicket.behavior.IBehavior; import wicket.feedback.FeedbackMessage; +import wicket.feedback.FeedbackMessages; import wicket.markup.ComponentTag; import wicket.markup.MarkupException; import wicket.markup.MarkupStream; @@ -457,6 +458,8 @@ private static final int FLAG_ATTACHING = 0x4000; private static final int FLAG_DETACHING = 0x8000; + /** List of feedback messages to add. */ + private transient List feedbackMessages; /** Basic model IModelComparator implementation for normal object models */ private static final IModelComparator defaultModelComparator = new IModelComparator() @@ -662,7 +665,7 @@ */ public final void debug(final String message) { - getPage().getFeedbackMessages().debug(this, message); + add(new FeedbackMessage(this, message, FeedbackMessage.DEBUG)); } /** @@ -685,7 +688,7 @@ */ public final void error(final Serializable message) { - getPage().getFeedbackMessages().error(this, message); + add(new FeedbackMessage(this, message, FeedbackMessage.ERROR)); } /** @@ -696,7 +699,7 @@ */ public final void fatal(final String message) { - getPage().getFeedbackMessages().fatal(this, message); + add(new FeedbackMessage(this, message, FeedbackMessage.FATAL)); } /** @@ -1235,7 +1238,7 @@ */ public final void info(final String message) { - getPage().getFeedbackMessages().info(this, message); + add(new FeedbackMessage(this, message, FeedbackMessage.INFO)); } /** @@ -2376,7 +2379,7 @@ */ public final void warn(final String message) { - getPage().getFeedbackMessages().warn(this, message); + add(new FeedbackMessage(this, message, FeedbackMessage.WARNING)); } /** @@ -2734,6 +2737,7 @@ { setFlag(FLAG_ATTACHING, true); setFlag(FLAG_ATTACHED, true); + onAttach(); if (getFlag(FLAG_ATTACHING)) { @@ -3023,6 +3027,40 @@ } /** +* Called by the containing page to enable components to add their +* temporarily stored feedback messages to the messages instance of the +* page. +* +* @param msgs +*The feedback messages. Components can add messages to it +*/ + final void addFeedback(final FeedbackMessages msgs) + { + // add deferred messages if any + if (feedbackMessages != null) + { + for (Iterator i = feedbackMessages.iterator(); i.hasNext();) + { + msgs.add((FeedbackMessage)i.next()); + } + // reset + feedbackMessages = null; + } + if (this instanceof MarkupContainer) + { + MarkupContainer container = (MarkupContainer)this; + container.visitChildren(new IVisitor() + { + public Object component(Component component) + {
Re: [Wicket-user] error(...) No page found for component
Apparently the usecase is pretty rare (only discovered after 2 years of production use) Well, you can't really know as you don't know how many people ever bumped across this and decided to implement a workaround without mentioning it to us. More importantly, I just don't think it is right users cannot do this, and there's a ton of ways to solve this. I agree with your queue idea, that's the nicest one. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] error(...) No page found for component
yeah, threadlocal would work. it would also get rid of the need for Session feedback messages. in some sense, i think the error is really being registered for the request (thread) anyway, not any object. so i like that idea. it can just be a threadlocal in the appropriate class and everyone's happy, we actually remove code and component stays the same size. +1 Eelco Hillenius wrote: Apparently the usecase is pretty rare (only discovered after 2 years of production use) Well, you can't really know as you don't know how many people ever bumped across this and decided to implement a workaround without mentioning it to us. More importantly, I just don't think it is right users cannot do this, and there's a ton of ways to solve this. I agree with your queue idea, that's the nicest one. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- View this message in context: http://www.nabble.com/error%28...%29-No-page-found-for-component-tf3497125.html#a9773504 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] error(...) No page found for component
if you can wait, i think we're going to be fixing this so you don't have to make any changes. serban.balamaci wrote: Thanks for the answer. Do you mean that instead of doing the loading of the model in the constructor to do it onAttach() ? Jonathan Locke wrote: You component is not attached to a parent yet. You could try doing that work in onAttach(). serban.balamaci wrote: Hi. I have a problem in that inside the constructor of a page(panel actually) i invoke a stored procedure which needs to get the model for the panel. The stored procedure may throw an error message. The error message should be seen by the user, he can understand what he did wrong. So inside the constructor i have something like this: public PanelConstructor() { try { invoke stored procedure . } catch(UserPresentableException e) { error(e.getMessage); } } The problem is that if the error is thrown i get a No page found for component. I understand that the cause of the error is that the error component not being instantiated because of the constructor not being finished(or i think that's the cause). Any ideas of solutions that i can implement? I know that i could set wicket to production instead of development and get rid of the stack trace. The problem is that i would like to keep the error message - to show the error message back to the user-. Should i instead of doing error(e.getMessage) rethrow the message inside a new defined exception and have a custom error page for that exception in which i would show only the message of the error. Is there any option that would keep me from treating the errors in the constructor other than how i treat an error from a button push in which i do error(e.getMessage())? Thanks. -- View this message in context: http://www.nabble.com/error%28...%29-No-page-found-for-component-tf3497125.html#a9773512 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] error(...) No page found for component
i am not so sure this is correct. we often deal with two page instances inside the same request - the current one and the response page. this breaks any kind of scoping as errors reported against current page will now make it into response page? dont know how likely the above usecase is, but probably more likely then having to report errors at component construction. -igor On 3/31/07, Jonathan Locke [EMAIL PROTECTED] wrote: yeah, threadlocal would work. it would also get rid of the need for Session feedback messages. in some sense, i think the error is really being registered for the request (thread) anyway, not any object. so i like that idea. it can just be a threadlocal in the appropriate class and everyone's happy, we actually remove code and component stays the same size. +1 Eelco Hillenius wrote: Apparently the usecase is pretty rare (only discovered after 2 years of production use) Well, you can't really know as you don't know how many people ever bumped across this and decided to implement a workaround without mentioning it to us. More importantly, I just don't think it is right users cannot do this, and there's a ton of ways to solve this. I agree with your queue idea, that's the nicest one. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- View this message in context: http://www.nabble.com/error%28...%29-No-page-found-for-component-tf3497125.html#a9773504 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] error(...) No page found for component
On 3/31/07, Igor Vaynberg [EMAIL PROTECTED] wrote: i am not so sure this is correct. we often deal with two page instances inside the same request - the current one and the response page. this breaks any kind of scoping as errors reported against current page will now make it into response page? About the session messages... well, they have a slightly different meaning: display whenever there is a feedback component rendered on any page. This is useful when writing generic software where you know that a message should be displayed, but you just don't know the target (e.g. at the end of a wizard). About per-page or per-request... yeah, we've been there too. If we look back at the history we can say that the page is the correct place to have it. So, what we should do is put the messages for the pages in the session, and at the start of rendering (right before attach), iterate through those messages and the ones that have components attached (are for pages) are then added to those pages. If there are messages with components that are not coupled to a page, well tough luck and discard them (those would throw an exception currently). One final thing we should fix is the fact that feedbackmessages don't get cleaned up when there are no feedback components in the page. This is a memory leak. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] error(...) No page found for component
Do feedbackmessages in the session really need to be synchronized with CopyOnWriteArrayList? I'm in doubt whether synchronization helps that much, but if it does, wouldn't it be more efficient to use a normal synchronized one? Eelco On 3/31/07, Eelco Hillenius [EMAIL PROTECTED] wrote: On 3/31/07, Igor Vaynberg [EMAIL PROTECTED] wrote: i am not so sure this is correct. we often deal with two page instances inside the same request - the current one and the response page. this breaks any kind of scoping as errors reported against current page will now make it into response page? About the session messages... well, they have a slightly different meaning: display whenever there is a feedback component rendered on any page. This is useful when writing generic software where you know that a message should be displayed, but you just don't know the target (e.g. at the end of a wizard). About per-page or per-request... yeah, we've been there too. If we look back at the history we can say that the page is the correct place to have it. So, what we should do is put the messages for the pages in the session, and at the start of rendering (right before attach), iterate through those messages and the ones that have components attached (are for pages) are then added to those pages. If there are messages with components that are not coupled to a page, well tough luck and discard them (those would throw an exception currently). One final thing we should fix is the fact that feedbackmessages don't get cleaned up when there are no feedback components in the page. This is a memory leak. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] error(...) No page found for component
Eelco Hillenius wrote: About the session messages... well, they have a slightly different meaning: display whenever there is a feedback component rendered on any page. This is useful when writing generic software where you know that a message should be displayed, but you just don't know the target (e.g. at the end of a wizard). yeah, i don't know what i was thinking... threadlocal clearly doesn't work for session scoping. duh. ;-) Eelco Hillenius wrote: About per-page or per-request... yeah, we've been there too. If we look back at the history we can say that the page is the correct place to have it. We chose that, yes. But would it be better to simply have all feedback messages stored in the session? That would solve all our scoping problems wouldn't it? Every feedback message would go into the session and then feedback panels could pull them out when they're ready to. If a feedback message is in the session for more than one request cycle and it is not cleared by a feedback panel, we would discard it (and maybe warn in debug mode). -- View this message in context: http://www.nabble.com/error%28...%29-No-page-found-for-component-tf3497125.html#a9773999 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] error(...) No page found for component
We chose that, yes. But would it be better to simply have all feedback messages stored in the session? That would solve all our scoping problems wouldn't it? Every feedback message would go into the session and then feedback panels could pull them out when they're ready to. If a feedback message is in the session for more than one request cycle and it is not cleared by a feedback panel, we would discard it (and maybe warn in debug mode). I think I'm fine with a session based solution. The thing that wouldn't work anymore is when you assign messages to components/ pages which are not rendered this request but a next request. That might be too far-fetched to support though. However, the solution which I'll post as a patch on the end of this message will support anything it does now. The thing I like about putting them in the session is that it is clean and will save a little bit of memory in the page. WDYT? Eelco Index: /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java === --- /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java (revision 524461) +++ /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java (working copy) @@ -662,7 +662,7 @@ */ public final void debug(final String message) { - getPage().getFeedbackMessages().debug(this, message); + Page.addMessage(new FeedbackMessage(this, message, FeedbackMessage.DEBUG)); } /** @@ -685,7 +685,7 @@ */ public final void error(final Serializable message) { - getPage().getFeedbackMessages().error(this, message); + Page.addMessage(new FeedbackMessage(this, message, FeedbackMessage.ERROR)); } /** @@ -696,7 +696,7 @@ */ public final void fatal(final String message) { - getPage().getFeedbackMessages().fatal(this, message); + Page.addMessage(new FeedbackMessage(this, message, FeedbackMessage.FATAL)); } /** @@ -1235,7 +1235,7 @@ */ public final void info(final String message) { - getPage().getFeedbackMessages().info(this, message); + Page.addMessage(new FeedbackMessage(this, message, FeedbackMessage.INFO)); } /** @@ -2376,7 +2376,7 @@ */ public final void warn(final String message) { - getPage().getFeedbackMessages().warn(this, message); + Page.addMessage(new FeedbackMessage(this, message, FeedbackMessage.WARNING)); } /** Index: /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/feedback/FeedbackMessages.java === --- /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/feedback/FeedbackMessages.java (revision 524461) +++ /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/feedback/FeedbackMessages.java (working copy) @@ -301,7 +301,7 @@ * @param message * @param level */ - public final void add(Component reporter, String message, int level) { + public final void add(Component reporter, Serializable message, int level) { add(new FeedbackMessage(reporter, message, level)); } @@ -311,7 +311,7 @@ * @param message *the message */ - final void add(FeedbackMessage message) + public final void add(FeedbackMessage message) { if (log.isDebugEnabled()) { Index: /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Page.java === --- /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Page.java (revision 524461) +++ /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Page.java (working copy) @@ -18,6 +18,7 @@ import java.util.ArrayList; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Set; @@ -25,6 +26,7 @@ import org.apache.commons.logging.LogFactory; import wicket.authorization.UnauthorizedActionException; +import wicket.feedback.FeedbackMessage; import wicket.feedback.FeedbackMessages; import wicket.feedback.IFeedback; import wicket.markup.MarkupException; @@ -288,23 +290,24 @@ */ public void detachModels() { -// // visit all this page's children to detach the models -// visitChildren(new
Re: [Wicket-user] error(...) No page found for component
yeah, your patch would work, but i think we agree that the session approach is better and cleaner (both functionally and conceptually) for the long term even if it could at least /conceivably/ break some especially odd code (which it seems likely does not even exist). the semantics are actually quite nice in the session version. messages added directly to the session would still have a null reporter and persist until rendered, as they currently do (no changes there). messages reported by components would all be cleared at the end of a request (not the beginning of the next one). this is conceptually clearer and simpler and it actually reduces memory load (as does the removal of all aspects of feedback message storage from Page). so i can't actually see any important disadvantage to the session approach. and there seem to be several nice little wins. probably less code too. Eelco Hillenius wrote: We chose that, yes. But would it be better to simply have all feedback messages stored in the session? That would solve all our scoping problems wouldn't it? Every feedback message would go into the session and then feedback panels could pull them out when they're ready to. If a feedback message is in the session for more than one request cycle and it is not cleared by a feedback panel, we would discard it (and maybe warn in debug mode). I think I'm fine with a session based solution. The thing that wouldn't work anymore is when you assign messages to components/ pages which are not rendered this request but a next request. That might be too far-fetched to support though. However, the solution which I'll post as a patch on the end of this message will support anything it does now. The thing I like about putting them in the session is that it is clean and will save a little bit of memory in the page. WDYT? Eelco Index: /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java === --- /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java (revision 524461) +++ /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java (working copy) @@ -662,7 +662,7 @@ */ public final void debug(final String message) { - getPage().getFeedbackMessages().debug(this, message); + Page.addMessage(new FeedbackMessage(this, message, FeedbackMessage.DEBUG)); } /** @@ -685,7 +685,7 @@ */ public final void error(final Serializable message) { - getPage().getFeedbackMessages().error(this, message); + Page.addMessage(new FeedbackMessage(this, message, FeedbackMessage.ERROR)); } /** @@ -696,7 +696,7 @@ */ public final void fatal(final String message) { - getPage().getFeedbackMessages().fatal(this, message); + Page.addMessage(new FeedbackMessage(this, message, FeedbackMessage.FATAL)); } /** @@ -1235,7 +1235,7 @@ */ public final void info(final String message) { - getPage().getFeedbackMessages().info(this, message); + Page.addMessage(new FeedbackMessage(this, message, FeedbackMessage.INFO)); } /** @@ -2376,7 +2376,7 @@ */ public final void warn(final String message) { - getPage().getFeedbackMessages().warn(this, message); + Page.addMessage(new FeedbackMessage(this, message, FeedbackMessage.WARNING)); } /** Index: /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/feedback/FeedbackMessages.java === --- /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/feedback/FeedbackMessages.java (revision 524461) +++ /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/feedback/FeedbackMessages.java (working copy) @@ -301,7 +301,7 @@ * @param message * @param level */ - public final void add(Component reporter, String message, int level) { + public final void add(Component reporter, Serializable message, int level) { add(new FeedbackMessage(reporter, message, level)); } @@ -311,7 +311,7 @@ * @param message *the message */ - final void add(FeedbackMessage message) + public final void add(FeedbackMessage message) { if (log.isDebugEnabled()) { Index: /Users/eelcohillenius/Documents/workspace_wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Page.java
Re: [Wicket-user] error(...) No page found for component
Yeah, that does sound like overkill in a single-threaded environment. What other thread would ever be accessing a session's feedback messages? Eelco Hillenius wrote: Do feedbackmessages in the session really need to be synchronized with CopyOnWriteArrayList? I'm in doubt whether synchronization helps that much, but if it does, wouldn't it be more efficient to use a normal synchronized one? Eelco On 3/31/07, Eelco Hillenius [EMAIL PROTECTED] wrote: On 3/31/07, Igor Vaynberg [EMAIL PROTECTED] wrote: i am not so sure this is correct. we often deal with two page instances inside the same request - the current one and the response page. this breaks any kind of scoping as errors reported against current page will now make it into response page? About the session messages... well, they have a slightly different meaning: display whenever there is a feedback component rendered on any page. This is useful when writing generic software where you know that a message should be displayed, but you just don't know the target (e.g. at the end of a wizard). About per-page or per-request... yeah, we've been there too. If we look back at the history we can say that the page is the correct place to have it. So, what we should do is put the messages for the pages in the session, and at the start of rendering (right before attach), iterate through those messages and the ones that have components attached (are for pages) are then added to those pages. If there are messages with components that are not coupled to a page, well tough luck and discard them (those would throw an exception currently). One final thing we should fix is the fact that feedbackmessages don't get cleaned up when there are no feedback components in the page. This is a memory leak. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- View this message in context: http://www.nabble.com/error%28...%29-No-page-found-for-component-tf3497125.html#a9774835 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] error(...) No page found for component
Yeah, that does sound like overkill in a single-threaded environment. What other thread would ever be accessing a session's feedback messages? Furthermore, copy on write is efficient when there are lots of reads and just a couple of writes, but that's not the case I think. So normal synchronization would almost certain be more efficient here. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] error(...) No page found for component
copy on write has the advantage when it comes to iterating over the list. the locking needs to be there because we lock on pagemaps and not on session, so two pages in different pagemaps would need to be synced. -igor On 3/31/07, Eelco Hillenius [EMAIL PROTECTED] wrote: Yeah, that does sound like overkill in a single-threaded environment. What other thread would ever be accessing a session's feedback messages? Furthermore, copy on write is efficient when there are lots of reads and just a couple of writes, but that's not the case I think. So normal synchronization would almost certain be more efficient here. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user