Graceful Session Expiry
Hi, I want to be able to show a Warning message appear when the session is about to expire (say 5 minutes before) and if the session has expired then on the UI it should come. This is to ensure a User does not enter any data and lose it when they click Submit. Use Case I wanna prevent: Lazy User goes for Coffee, comes back completes Form, presses Submit ...curses me! thanks - Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Graceful-Session-Expiry-tp3584660p3584660.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Drop down Multilevel Navigation in Wicket
Hi Dimiter, I have not implemented a multi-level, mouseover-based menu system, but I can offer the following general advice. Wicket makes it easy for client-side events to trigger callbacks in your server-side Java application, from which you can, for example, render new content into existing DOM elements. However, since this approach requires an AJAX request for each event, the user will experience slight delays in seeing the responses to his events. Therefore it is far more typical to provide a menu drill-down experience entirely in client-side JavaScript, selectively hiding or showing DOM content based on user input. Only when the user selects a menu item (e.g. by clicking a link) does Wicket become involved. Hope that helps, Dan On Wed, Jun 8, 2011 at 7:36 AM, Dimiter Dimitrov wrote: > Hi guys! > > I'm relatively new to the Wicket and am still learning so in advance, > excuse me if I've missed anything. > What I'm looking for and I can not find a solution for is how can I > create a multi level dropdown navigation in Wicket? I mean, the > popular multi level dropdown navigation (CSS/JS-based) that when user > mouseOver the link, a subset of sublinks appears. > I was looking at the Wicket components section but did not see such. How > may > I create > such a navigation in terms of Wicket, guys? > > > Thanks in advance! > > > -- > Kind Regards: > Dimitar Dimitrov >
Re: Session MetaData Synchronization and Flushing
For what it's worth, encapsulating Session#setMetaData() and Session#getMetaData() to work around this issue led me to the following pattern which I'm really enjoying. Synchronization and dirtying are omitted here for brevity. SessionMetaDataModel implements IModel { private final MetaDataKey key; public SessionMetaDataModel(MetaDataKey key) { this.key = key; } public static IModel of(MetaDataKey key) { return new SessionMetaDataModel(key); } public T getObject() { return session.getMetaData(key); } public void setObject(T object) { session.setMetaData(key, object); } public void detach() {} } Then in the class that defines the metadata: private static final IModel STRING_MODEL = SessionMetaDataModel.of(new MetaDataKey{ }); Essentially we've just replaced the static final MetaDataKey with a static final IModel, which plays nicer with components and whose use is easier on the eyes. Dan On Wed, Jun 8, 2011 at 11:45 AM, Dan Retzlaff wrote: > https://issues.apache.org/jira/browse/WICKET-3779 > > > On Wed, Jun 8, 2011 at 11:32 AM, Igor Vaynberg wrote: > >> most likely it is an oversight. open an issue. at some point session >> access was synchronized, but later it was made more granular. the >> metadata code may have never been updated. >> >> -igor >> >> >> On Wed, Jun 8, 2011 at 11:29 AM, Dan Retzlaff >> wrote: >> > Hey all, >> > >> > Can someone help me understand the synchronization and dirty-marking >> > requirements surrounding Session#setMetaData()? I thought the rules for >> > Session use were (1) synchronize data access, (2) call Session#dirty() >> after >> > data changes to replicate the changes across the cluster. However, I >> don't >> > see either of these happening in Wicket's internal use of Session >> MetaData. >> > Is this an oversight, or am I missing something? >> > >> > Thanks, >> > Dan >> > >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >
Re: ContextImage and external URL
I would create your own 'ContextImage' that does exactly what you want. Extend component, override oncomponenttag and put the model value into the src attribute. Martijn On Tue, Jun 7, 2011 at 11:46 PM, Daniele Dellafiore wrote: > Hi. > > I take some user uploaded images from an external service that answer > at, say, localhost:8181/images > My wicket app run on localhost:9191/app > I want to load the images from the first service, and I'd like to use > a ContextImage that is easy to use: > > new ContextImage("picture", "images/ + code); > > This of course does not work cause the base of the ContextImage points to > 9191. > > I could use something else but I like ContextImage, One idea is to > have something like a filter set up in web.xml that redirect each call > to /images to a custom url like localhost:8181/images. > > What do you think? Also, I really do not have a clear idea on how to > do that in a nice way, any tip? > > -- > Daniele Dellafiore > http://danieledellafiore.net > > - > 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket-dnd not working on IE9 and only partially on IE8
Without looking at the implementation, to see if the styling is causing an issue: 1) Delete all style declarations from the css file (i.e. blank it) 2) See if the issue persists - in which case it's probably something else 3) Add your style declarations back one at a time to the css file to see which one causes the problem - Original Message - From: "lucast" To: users@wicket.apache.org Sent: Wednesday, 8 June, 2011 6:18:57 PM Subject: Re: wicket-dnd not working on IE9 and only partially on IE8 Hi Sven, I found what causes the drop functionality not to work on IE8. I have a panel which has wicket-dnd draggable and droppable functionality. I allocate that panel to each table cell. On the html file for the panel, I have the following header which already exists on the homePage.html file: If I remove that from SlotDragDropPanel.html (attached), then wicket-dnd works fine on IE8. Why that is, I just don't know. I should find out but I'm just happy and relieved to have got this out of the way with my release date so soon. Attached are the files I used for this app. http://apache-wicket.1842946.n4.nabble.com/file/n3583128/WicketApplication.java WicketApplication.java http://apache-wicket.1842946.n4.nabble.com/file/n3583128/HomePage.java HomePage.java http://apache-wicket.1842946.n4.nabble.com/file/n3583128/HomePage.html HomePage.html http://apache-wicket.1842946.n4.nabble.com/file/n3583128/GuestListView.java GuestListView.java http://apache-wicket.1842946.n4.nabble.com/file/n3583128/SlotDragDropPanel.java SlotDragDropPanel.java http://apache-wicket.1842946.n4.nabble.com/file/n3583128/SlotDragDropPanel.html SlotDragDropPanel.html http://apache-wicket.1842946.n4.nabble.com/file/n3583128/style.css style.css If you comment out the head section on SlotDragDropPanel.html then the problem disappears. Thanks for taking the time to look into this, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-dnd-not-working-on-IE9-and-only-partially-on-IE8-tp3580258p3583128.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: navigation menu
Hi, why not use the 'tutsplus' code which you like and bind the links to bookmarkable pages? You could also inject some variables (e.g. the urls) into javascript from wicket: private HeaderContributor contrib = new HeaderContributor( new IHeaderContributor() { @Override public void renderHead(IHeaderResponse response) { PageParameters params = new PageParameters(); params.add("myparam", "true"); String url = RequestUtils.toAbsolutePath(urlFor(MyPage1.class, params).toString()); response.renderJavascript("var myurl1 = '" + url + "';", "myjsinjection"); } }); of course this should be injected before the external code: public void init(final PageParameters parameters) { add(contrib); add(new HeaderContributor( new IHeaderContributor() { public void renderHead(IHeaderResponse response) { response.renderJavascriptReference("js/external.js"); } }));} Would this help? Regards, Peter. > http://code.google.com/p/wicket-menu/ > > Not complete but if you see the source code, it will give you an idea. > > cheers, > -fatih > > On 8 June 2011 16:28, hubert_hupe wrote: >> hi guys, >> >> i have no clue how to create a simple navigation bar like this: >> http://net.tutsplus.com/tutorials/javascript-ajax/a-different-top-navigation/ >> if possible i need images for the headlines. >> when you move the mouse over the menu it drops down - there are millions of >> website with this functionality. >> the problem is: i have to ceate the menu dynamically. the informations which >> menuitem should be in the menu comes from the database. so i cannot use a >> static javascript code in the html file. >> is anybody there who can give me a hint or even an example? >> >> best regards >> >> hubert -- http://jetwick.com open twitter search - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Session MetaData Synchronization and Flushing
https://issues.apache.org/jira/browse/WICKET-3779 On Wed, Jun 8, 2011 at 11:32 AM, Igor Vaynberg wrote: > most likely it is an oversight. open an issue. at some point session > access was synchronized, but later it was made more granular. the > metadata code may have never been updated. > > -igor > > > On Wed, Jun 8, 2011 at 11:29 AM, Dan Retzlaff wrote: > > Hey all, > > > > Can someone help me understand the synchronization and dirty-marking > > requirements surrounding Session#setMetaData()? I thought the rules for > > Session use were (1) synchronize data access, (2) call Session#dirty() > after > > data changes to replicate the changes across the cluster. However, I > don't > > see either of these happening in Wicket's internal use of Session > MetaData. > > Is this an oversight, or am I missing something? > > > > Thanks, > > Dan > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Drop down Multilevel Navigation in Wicket
Hi guys! I'm relatively new to the Wicket and am still learning so in advance, excuse me if I've missed anything. What I'm looking for and I can not find a solution for is how can I create a multi level dropdown navigation in Wicket? I mean, the popular multi level dropdown navigation (CSS/JS-based) that when user mouseOver the link, a subset of sublinks appears. I was looking at the Wicket components section but did not see such. How may I create such a navigation in terms of Wicket, guys? Thanks in advance! -- Kind Regards: Dimitar Dimitrov
Re: Session MetaData Synchronization and Flushing
most likely it is an oversight. open an issue. at some point session access was synchronized, but later it was made more granular. the metadata code may have never been updated. -igor On Wed, Jun 8, 2011 at 11:29 AM, Dan Retzlaff wrote: > Hey all, > > Can someone help me understand the synchronization and dirty-marking > requirements surrounding Session#setMetaData()? I thought the rules for > Session use were (1) synchronize data access, (2) call Session#dirty() after > data changes to replicate the changes across the cluster. However, I don't > see either of these happening in Wicket's internal use of Session MetaData. > Is this an oversight, or am I missing something? > > Thanks, > Dan > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Got some code for you (ObjectSizeOfAgent)
Hey, a while ago I wrote about the difficulties to get the ObjectSizeOfAgent to run. As I needed it pretty badly for a project I built something new and added some more accurate size measurement for objects. I put all my code on Github and I am going to add some more performance related things in there. https://github.com/pflanzenmoerder/object-size/ I copied the code from the size of agent (with proper mentioning of where I got it from) and added it as one of the possible strategies to estimate the size of pages in ram. It all uses AspectJ and has no direct dependencies to Wicket and can be deploied as an agent using LoadTimeWeaving. It's all Appache 2 License (I hope that's correct). Would that be of any interest for the Wicket-project? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Session MetaData Synchronization and Flushing
Hey all, Can someone help me understand the synchronization and dirty-marking requirements surrounding Session#setMetaData()? I thought the rules for Session use were (1) synchronize data access, (2) call Session#dirty() after data changes to replicate the changes across the cluster. However, I don't see either of these happening in Wicket's internal use of Session MetaData. Is this an oversight, or am I missing something? Thanks, Dan
Re: I18n for buttons
Doesn't sound like https://issues.apache.org/jira/browse/WICKET-3727 but who knows. On Wed, Jun 8, 2011 at 6:23 PM, Craig Pardey wrote: > Hi, > > I am using i18n in Wicket to set the value on a button. > > The markup for the button is > > > The value does not get translated if "save" is in the application-level > resource bundle. It only gets translated if "save" is in the page-level > resource bundle. > > Is my markup incorrect, or is this a bug? > > CP > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Blog on my experiences learning Wicket
On Jun 8, 2011, at 12:54 PM, Brian Lavender wrote: > And yes, my blog uses Wordpress, not Wicket quite yet. If you are going to make your blog out of Wicket, you might want to consider using Brix (http://www.brixcms.org). It welds a NoSQL document database to Wicket, along with some basic page management functionality, providing the most important parts of a content management system to Wicket, which of course provides the best of component-oriented web development in Java. In the end, you get a content management system with dynamic components that are written the Wicket way. Imagine your HTML being stored in a database that is accessible to non-technical folks, without losing the power of Wicket components. That's Brix! If you check it out, the Brix demo app is a great place to start. Congrats on your work and welcome to Wicket! Cheers, Brian - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket-dnd not working on IE9 and only partially on IE8
Hi Sven, I found what causes the drop functionality not to work on IE8. I have a panel which has wicket-dnd draggable and droppable functionality. I allocate that panel to each table cell. On the html file for the panel, I have the following header which already exists on the homePage.html file: If I remove that from SlotDragDropPanel.html (attached), then wicket-dnd works fine on IE8. Why that is, I just don't know. I should find out but I'm just happy and relieved to have got this out of the way with my release date so soon. Attached are the files I used for this app. http://apache-wicket.1842946.n4.nabble.com/file/n3583128/WicketApplication.java WicketApplication.java http://apache-wicket.1842946.n4.nabble.com/file/n3583128/HomePage.java HomePage.java http://apache-wicket.1842946.n4.nabble.com/file/n3583128/HomePage.html HomePage.html http://apache-wicket.1842946.n4.nabble.com/file/n3583128/GuestListView.java GuestListView.java http://apache-wicket.1842946.n4.nabble.com/file/n3583128/SlotDragDropPanel.java SlotDragDropPanel.java http://apache-wicket.1842946.n4.nabble.com/file/n3583128/SlotDragDropPanel.html SlotDragDropPanel.html http://apache-wicket.1842946.n4.nabble.com/file/n3583128/style.css style.css If you comment out the head section on SlotDragDropPanel.html then the problem disappears. Thanks for taking the time to look into this, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-dnd-not-working-on-IE9-and-only-partially-on-IE8-tp3580258p3583128.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Blog on my experiences learning Wicket
Hello everyone, I have been blogging regarding my experience using Wicket based upon my experience learning Wicket using the "Wicket in Action" book by Dashorst et al. using different takes or perhaps just my experience breaking down the examples from the book. In others, I do a simple additions. My issue with the book code is that it is in just one big example and it was not clear how to me how to break out the pieces. Since the example code is Apache license, I just hacked them differently releasing with the same license. I of errors, so please comment if you find that things aren't quite right. http://brie.com/brian/blog/?cat=8 Thus far, my blog entries focus on a simple project importable into Eclipse and runnable using Maven. You can either download each sample referencing the blog entry, or just download and hack them directly. http://brie.com/brian/wicket/ And yes, my blog uses Wordpress, not Wicket quite yet. brian -- Brian Lavender http://www.brie.com/brian/ "There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies." Professor C. A. R. Hoare The 1980 Turing award lecture - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
I18n for buttons
Hi, I am using i18n in Wicket to set the value on a button. The markup for the button is The value does not get translated if "save" is in the application-level resource bundle. It only gets translated if "save" is in the page-level resource bundle. Is my markup incorrect, or is this a bug? CP
Re: navigation menu
http://code.google.com/p/wicket-menu/ Not complete but if you see the source code, it will give you an idea. cheers, -fatih On 8 June 2011 16:28, hubert_hupe wrote: > hi guys, > > i have no clue how to create a simple navigation bar like this: > http://net.tutsplus.com/tutorials/javascript-ajax/a-different-top-navigation/ > if possible i need images for the headlines. > when you move the mouse over the menu it drops down - there are millions of > website with this functionality. > the problem is: i have to ceate the menu dynamically. the informations which > menuitem should be in the menu comes from the database. so i cannot use a > static javascript code in the html file. > is anybody there who can give me a hint or even an example? > > best regards > > hubert > - > 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
navigation menu
hi guys, i have no clue how to create a simple navigation bar like this: http://net.tutsplus.com/tutorials/javascript-ajax/a-different-top-navigation/ if possible i need images for the headlines. when you move the mouse over the menu it drops down - there are millions of website with this functionality. the problem is: i have to ceate the menu dynamically. the informations which menuitem should be in the menu comes from the database. so i cannot use a static javascript code in the html file. is anybody there who can give me a hint or even an example? best regards hubert - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: adding items dynamically to ListView
Just resolved the issue. The problem was that I wasnt setting "container.setOutputMarkupId(true);" before I initially added the container to the page. I was setting it when the user clicked a button, which always occurred after the container was initially added. My original flow was something like this: WicketPanel class { ... instantiate container ajax onClick() { container.setOutputMarkupId(true); target.addComponent(container) } add(container) } It needs to be like this: WicketPanel class { ... instantiate container container.setOutputMarkupId(true); ajax onClick() { target.addComponent(container) } add(container) } Makes sense. Thanks for all the help -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/adding-items-dynamically-to-ListView-tp3580840p3582682.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: adding items dynamically to ListView
Here is my bean class, followed by a panel class where I set up the PropertyModel and the ListView, followed lastly by the panel's markup BEAN: public class IncidentListBean implements Serializable { List incList; public IncidentListBean() { incList = new ArrayList(); } public List getIncList() { return incList; } public void setIncList(List list) { incList = list; } } PANEL: public class IncidentPanel extends Panel { transient List incList = DashboardServiceAccessor.get("SELECT * FROM MY_DB"); IncidentListBean bean = new IncidentListBean(); PropertyModel propMod; ListView listView; WebMarkupContainer container; public IncidentPanel(String id) { super(id); //set up the property model that will represent the listView below bean.setIncList(incList); propMod = new PropertyModel(bean, "incList"); container = new WebMarkupContainer("repeaterContainer"); //ListView listView = new ListView("individualReport", propMod) { protected void populateItem(ListItem item) { Incident i = new Incident(); i = (Incident)item.getModelObject(); item.add(new Label("description",i.getDescription())); } }; } ... } MARKUP FOR PANEL: Incidents new+ -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/adding-items-dynamically-to-ListView-tp3580840p3582606.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: WicketRuntimeException
I don't see anything in the logs but I will look. I will try kill -3 pid when it happens again. -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Wednesday, June 08, 2011 9:38 AM To: users@wicket.apache.org Subject: Re: WicketRuntimeException This is the wrong thread. I bet there is another one with longer stack. On Wed, Jun 8, 2011 at 3:27 PM, Jeffrey Schneller wrote: > Thanks for the idea of using kill -3 pid > > I don't see the page in the stack trace which is below, unless it is the line > I have started with ===>. > > > > org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap null is > still locked by: Thread[TP-Processor24,5,main], giving up trying to get the > page for path: 4:products:0:prodBuyLink > > Stack Trace: > org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262) > org.apache.wicket.protocol.https.HttpsRequestCycleProcessor.resolve(HttpsRequestCycleProcessor.java:219) > org.apache.wicket.RequestCycle.step(RequestCycle.java:1310) > org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436) > org.apache.wicket.RequestCycle.request(RequestCycle.java:545) > org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486) > org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319) > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > ===>com.myapp.web.MDCSessionFilter.doFilter(MDCSessionFilter.java:40) > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) > org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) > org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) > org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769) > org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698) > org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891) > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) > java.lang.Thread.run(Thread.java:619) > > -Original Message- > From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] > Sent: Wednesday, June 08, 2011 3:30 AM > To: users@wicket.apache.org > Subject: Re: WicketRuntimeException > > The stack trace shows the page that is holding the lock as well > > Martijn > > On Wed, Jun 8, 2011 at 7:20 AM, Martin Grigorov wrote: >> On Wed, Jun 8, 2011 at 7:00 AM, Jeffrey Schneller >> wrote: >>> I have started to see more and more of the following exception when >>> users are using the wicket app. >>> >>> >>> >>> org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap >>> null is still locked by: Thread[TP-Processor24,5,main], giving up trying >>> to get the page for path: 4:products:0:prodBuyLink >>> >>> >>> >>> If my understanding is right, it is a timeout that is occurring because >>> the app is still processing for the page that is trying to be viewed. >>> Is this correct? Any ideas on how to debug or solve? What are some >>> common reasons for this type of exception? >> >> Correct. You can dump the thread's state with tools like jconsole or >> on unix machines with "kill -3 pid". >> Making several dumps you will see the thread that is "stuck". >>> >>> >>> >>> >>> >>> >> >> >> >> -- >> Martin Grigorov >> jWeekend >> Training, Consulting, Development >> http://jWeekend.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 > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@w
Re: ContextImage and external URL
Do you think that can be good also if I want to let the browser cache some images? I serve thumbnails that I do not want to be server every time. On Tue, Jun 7, 2011 at 11:52 PM, Martin Grigorov wrote: > use Image with DynamicImageResource which loads the image with > urlConnection > > On Tue, Jun 7, 2011 at 11:46 PM, Daniele Dellafiore > wrote: > > Hi. > > > > I take some user uploaded images from an external service that answer > > at, say, localhost:8181/images > > My wicket app run on localhost:9191/app > > I want to load the images from the first service, and I'd like to use > > a ContextImage that is easy to use: > > > > new ContextImage("picture", "images/ + code); > > > > This of course does not work cause the base of the ContextImage points to > 9191. > > > > I could use something else but I like ContextImage, One idea is to > > have something like a filter set up in web.xml that redirect each call > > to /images to a custom url like localhost:8181/images. > > > > What do you think? Also, I really do not have a clear idea on how to > > do that in a nice way, any tip? > > > > -- > > Daniele Dellafiore > > http://danieledellafiore.net > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > > > -- > Martin Grigorov > jWeekend > Training, Consulting, Development > http://jWeekend.com > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Daniele Dellafiore http://danieledellafiore.net
Re: WicketRuntimeException
This is the wrong thread. I bet there is another one with longer stack. On Wed, Jun 8, 2011 at 3:27 PM, Jeffrey Schneller wrote: > Thanks for the idea of using kill -3 pid > > I don't see the page in the stack trace which is below, unless it is the line > I have started with ===>. > > > > org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap null is > still locked by: Thread[TP-Processor24,5,main], giving up trying to get the > page for path: 4:products:0:prodBuyLink > > Stack Trace: > org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262) > org.apache.wicket.protocol.https.HttpsRequestCycleProcessor.resolve(HttpsRequestCycleProcessor.java:219) > org.apache.wicket.RequestCycle.step(RequestCycle.java:1310) > org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436) > org.apache.wicket.RequestCycle.request(RequestCycle.java:545) > org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486) > org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319) > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > ===>com.myapp.web.MDCSessionFilter.doFilter(MDCSessionFilter.java:40) > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) > org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) > org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) > org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769) > org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698) > org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891) > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) > java.lang.Thread.run(Thread.java:619) > > -Original Message- > From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] > Sent: Wednesday, June 08, 2011 3:30 AM > To: users@wicket.apache.org > Subject: Re: WicketRuntimeException > > The stack trace shows the page that is holding the lock as well > > Martijn > > On Wed, Jun 8, 2011 at 7:20 AM, Martin Grigorov wrote: >> On Wed, Jun 8, 2011 at 7:00 AM, Jeffrey Schneller >> wrote: >>> I have started to see more and more of the following exception when >>> users are using the wicket app. >>> >>> >>> >>> org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap >>> null is still locked by: Thread[TP-Processor24,5,main], giving up trying >>> to get the page for path: 4:products:0:prodBuyLink >>> >>> >>> >>> If my understanding is right, it is a timeout that is occurring because >>> the app is still processing for the page that is trying to be viewed. >>> Is this correct? Any ideas on how to debug or solve? What are some >>> common reasons for this type of exception? >> >> Correct. You can dump the thread's state with tools like jconsole or >> on unix machines with "kill -3 pid". >> Making several dumps you will see the thread that is "stuck". >>> >>> >>> >>> >>> >>> >> >> >> >> -- >> Martin Grigorov >> jWeekend >> Training, Consulting, Development >> http://jWeekend.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 > > - > 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 > > -- Martin Grigorov jWeekend Training, Consulting, Developm
RE: WicketRuntimeException
Thanks for the idea of using kill -3 pid I don't see the page in the stack trace which is below, unless it is the line I have started with ===>. org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap null is still locked by: Thread[TP-Processor24,5,main], giving up trying to get the page for path: 4:products:0:prodBuyLink Stack Trace: org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262) org.apache.wicket.protocol.https.HttpsRequestCycleProcessor.resolve(HttpsRequestCycleProcessor.java:219) org.apache.wicket.RequestCycle.step(RequestCycle.java:1310) org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436) org.apache.wicket.RequestCycle.request(RequestCycle.java:545) org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486) org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ===>com.myapp.web.MDCSessionFilter.doFilter(MDCSessionFilter.java:40) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769) org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698) org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) java.lang.Thread.run(Thread.java:619) -Original Message- From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] Sent: Wednesday, June 08, 2011 3:30 AM To: users@wicket.apache.org Subject: Re: WicketRuntimeException The stack trace shows the page that is holding the lock as well Martijn On Wed, Jun 8, 2011 at 7:20 AM, Martin Grigorov wrote: > On Wed, Jun 8, 2011 at 7:00 AM, Jeffrey Schneller > wrote: >> I have started to see more and more of the following exception when >> users are using the wicket app. >> >> >> >> org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap >> null is still locked by: Thread[TP-Processor24,5,main], giving up trying >> to get the page for path: 4:products:0:prodBuyLink >> >> >> >> If my understanding is right, it is a timeout that is occurring because >> the app is still processing for the page that is trying to be viewed. >> Is this correct? Any ideas on how to debug or solve? What are some >> common reasons for this type of exception? > > Correct. You can dump the thread's state with tools like jconsole or > on unix machines with "kill -3 pid". > Making several dumps you will see the thread that is "stuck". >> >> >> >> >> >> > > > > -- > Martin Grigorov > jWeekend > Training, Consulting, Development > http://jWeekend.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 - 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: A couple of questions about converter
Hi Andrea, On Wed, Jun 8, 2011 at 1:11 PM, Andrea Del Bene wrote: > Hi, > > I've started to explore the converting mechanism of wicket. I've red javadoc > and both Wicket in Action and Wicket Cookbook but there still be something > not completely clear to me. > Converter are created by converter locator, which creates one instance of > converter for each java type, right? So the first question is: are > converters thread safe? If I have two session with two different locale, is > DateConverter thread safe? Looking at the code - yes. DateConverter doesn't keep any state. > > The second question is: if converters are created and registered at > Application level, how can I implement a converter at Session level? > I want to implement a custom date converter based on a date patter which > depends on the current logged user. Well, yes, there is no delegation to the Session as there is such for some other "services" but you can always workaround it by registering your own locator at app level which checks for existing session and does something custom or just falls back to the default app locator. > > Thank you. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
A couple of questions about converter
Hi, I've started to explore the converting mechanism of wicket. I've red javadoc and both Wicket in Action and Wicket Cookbook but there still be something not completely clear to me. Converter are created by converter locator, which creates one instance of converter for each java type, right? So the first question is: are converters thread safe? If I have two session with two different locale, is DateConverter thread safe? The second question is: if converters are created and registered at Application level, how can I implement a converter at Session level? I want to implement a custom date converter based on a date patter which depends on the current logged user. Thank you. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket-dnd not working on IE9 and only partially on IE8
Hi Sven, I'm trying to build a standalone example of the error I am experiencing on IE8, but in the meantime, I thought about posting the html produced on both IE8 (where I'm experiencing the problem) and on Firefox (where there is no problem). I'll attach as text file so it doesn't clutter up this post. I'm implementing wicket-dnd on a table, and the html produced in IE8 has javascript functions and is a lot more verbose than on firefox. I am not sure if you'd be able to understand why it is producing that. I'll keep working on the standalone example in the meantime. Thanks, Lucas http://apache-wicket.1842946.n4.nabble.com/file/n3582180/wicket-dnd_tableCell_IE8.txt wicket-dnd_tableCell_IE8.txt http://apache-wicket.1842946.n4.nabble.com/file/n3582180/wicket-dnd_tableCell_Firefox.txt wicket-dnd_tableCell_Firefox.txt -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-dnd-not-working-on-IE9-and-only-partially-on-IE8-tp3580258p3582180.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [WICKET-3552] Is adding another parameter to the constructor required?
On Wed, Jun 8, 2011 at 11:26 AM, Martin Grigorov wrote: > If you have the karma you can miss the attaching part and commit > directly in SVN > dashorst ^^ Moved it to dev@ instead... Martijn - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [WICKET-3552] Is adding another parameter to the constructor required?
Jira and up and running and the last time I checked it still supports attaching files (patches) :-) If you have the karma you can miss the attaching part and commit directly in SVN dashorst ^^ 2011/6/8 Robert Dahlström : > +1 on skipping a boolean flag in the constructor. Igors suggestion to > provide a mode parameter feels like a good one. > > /Robert > > On 06/08/2011 10:18 AM, Martin Grigorov wrote: >> >> Hi Per, >> >> I see your point. >> It is just my opinion (and ticket's reporter) that this additional >> boolean parameter to the constructor is adds much less noise than >> adding additional 2 classes. >> If the name of AttributeAppender is changed to AtrributeAdder (because >> we are used that add(obj) appends and add(0, obj) prepends) then it >> will be much cleaner. >> >> Igor's suggestion also sounds OK to me. Then we can either deprecate >> AttributeAppender or add AttributePrepender and both of them will just >> have constructors that pass the proper mode to AttributeModifier. >> >> Create a ticket. >> >> On Wed, Jun 8, 2011 at 10:04 AM, Per Newgro wrote: >>> >>> Hi Martin Grigorov, >>> >>> But i made naming proposals: >>> AbstractAttributeRegister >>> | | >>> AttributeAppender AttributePrepender >>> >>> My pain in the ... is only that we have now 2 more constructors. This (in >>> my >>> opinion) >>> really important class should be clear in design and responsibility. >>> Another pain could become important if we decide to exchange the default >>> values >>> for prepend. Wicket did that already in history and it lead to confusion >>> and >>> required >>> app changes. >>> >>> The sense in "the one common parent" would be to provide the abstract >>> method >>> for value registering. The subclasses would have to implement that. >>> >>> package org.apache.wicket.behavior; >>> >>> import org.apache.wicket.AttributeModifier; >>> import org.apache.wicket.model.IModel; >>> import org.apache.wicket.util.string.AppendingStringBuffer; >>> import org.apache.wicket.util.string.Strings; >>> >>> public class AbstractAttributeRegister extends AttributeModifier >>> { >>> private static final long serialVersionUID = 1L; >>> >>> private final String separator; >>> >>> public AbstractAttributeRegister(String attribute, boolean >>> addAttributeIfNotPresent, >>> IModel appendModel, String separator) >>> { >>> this(attribute, addAttributeIfNotPresent, appendModel, separator); >>> } >>> >>> public AbstractAttributeRegister(String attribute, IModel >>> appendModel, >>> String separator) >>> { >>> this(attribute, true, appendModel, separator); >>> } >>> >>> >>> /** >>> * @see org.apache.wicket.AttributeModifier#newValue(java.lang.String, >>> java.lang.String) >>> */ >>> @Override >>> protected String newValue(String currentValue, String appendValue) >>> { >>> // Shortcut for empty values >>> if (Strings.isEmpty(currentValue)) >>> { >>> return appendValue != null ? appendValue : ""; >>> } >>> else if (Strings.isEmpty(appendValue)) >>> { >>> return currentValue; >>> } >>> >>> final AppendingStringBuffer sb = new >>> AppendingStringBuffer(currentValue.length() + >>> appendValue.length() + separator.length()); >>> >>> return registerValue(sb, currentValue, appendValue); >>> } >>> >>> protected abstract String registerValue(AppendingStringBuffer target, >>> String currentValue, String appendValue); >>> } >>> >>> public class AttributeAppender extends AbstractAttributeRegister >>> { >>> private static final long serialVersionUID = 1L; >>> >>> public AttributeAppender(String attribute, boolean >>> addAttributeIfNotPresent, >>> IModel appendModel, String separator) >>> { >>> super(attribute, addAttributeIfNotPresent, appendModel, >>> separator); >>> } >>> >>> public AttributeAppender(String attribute, IModel appendModel, >>> String >>> separator) >>> { >>> super(attribute, appendModel, separator); >>> } >>> >>> @Override >>> protected String registerValue(AppendingStringBuffer target, String >>> currentValue, String value, String separator) >>> { >>> sb.append(currentValue); >>> sb.append(separator); >>> sb.append(value); >>> return sb.toString(); >>> } >>> } >>> >>> public class AttributePrepender extends AbstractAttributeRegister >>> { >>> private static final long serialVersionUID = 1L; >>> >>> public AttributePrepender(String attribute, boolean >>> addAttributeIfNotPresent, >>> IModel appendModel, String separator) >>> { >>> super(attribute, addAttributeIfNotPresent, appendModel, >>> separator); >>> } >>> >>> public AttributePrepender(String attribute, IModel appendModel, >>> String >>> separator) >>> { >>> super(attribute, appendModel, separator); >>> } >>> >>> @Override >>>
Re: [WICKET-3552] Is adding another parameter to the constructor required?
+1 on skipping a boolean flag in the constructor. Igors suggestion to provide a mode parameter feels like a good one. /Robert On 06/08/2011 10:18 AM, Martin Grigorov wrote: Hi Per, I see your point. It is just my opinion (and ticket's reporter) that this additional boolean parameter to the constructor is adds much less noise than adding additional 2 classes. If the name of AttributeAppender is changed to AtrributeAdder (because we are used that add(obj) appends and add(0, obj) prepends) then it will be much cleaner. Igor's suggestion also sounds OK to me. Then we can either deprecate AttributeAppender or add AttributePrepender and both of them will just have constructors that pass the proper mode to AttributeModifier. Create a ticket. On Wed, Jun 8, 2011 at 10:04 AM, Per Newgro wrote: Hi Martin Grigorov, But i made naming proposals: AbstractAttributeRegister | | AttributeAppender AttributePrepender My pain in the ... is only that we have now 2 more constructors. This (in my opinion) really important class should be clear in design and responsibility. Another pain could become important if we decide to exchange the default values for prepend. Wicket did that already in history and it lead to confusion and required app changes. The sense in "the one common parent" would be to provide the abstract method for value registering. The subclasses would have to implement that. package org.apache.wicket.behavior; import org.apache.wicket.AttributeModifier; import org.apache.wicket.model.IModel; import org.apache.wicket.util.string.AppendingStringBuffer; import org.apache.wicket.util.string.Strings; public class AbstractAttributeRegister extends AttributeModifier { private static final long serialVersionUID = 1L; private final String separator; public AbstractAttributeRegister(String attribute, boolean addAttributeIfNotPresent, IModel appendModel, String separator) { this(attribute, addAttributeIfNotPresent, appendModel, separator); } public AbstractAttributeRegister(String attribute, IModel appendModel, String separator) { this(attribute, true, appendModel, separator); } /** * @see org.apache.wicket.AttributeModifier#newValue(java.lang.String, java.lang.String) */ @Override protected String newValue(String currentValue, String appendValue) { // Shortcut for empty values if (Strings.isEmpty(currentValue)) { return appendValue != null ? appendValue : ""; } else if (Strings.isEmpty(appendValue)) { return currentValue; } final AppendingStringBuffer sb = new AppendingStringBuffer(currentValue.length() + appendValue.length() + separator.length()); return registerValue(sb, currentValue, appendValue); } protected abstract String registerValue(AppendingStringBuffer target, String currentValue, String appendValue); } public class AttributeAppender extends AbstractAttributeRegister { private static final long serialVersionUID = 1L; public AttributeAppender(String attribute, boolean addAttributeIfNotPresent, IModel appendModel, String separator) { super(attribute, addAttributeIfNotPresent, appendModel, separator); } public AttributeAppender(String attribute, IModel appendModel, String separator) { super(attribute, appendModel, separator); } @Override protected String registerValue(AppendingStringBuffer target, String currentValue, String value, String separator) { sb.append(currentValue); sb.append(separator); sb.append(value); return sb.toString(); } } public class AttributePrepender extends AbstractAttributeRegister { private static final long serialVersionUID = 1L; public AttributePrepender(String attribute, boolean addAttributeIfNotPresent, IModel appendModel, String separator) { super(attribute, addAttributeIfNotPresent, appendModel, separator); } public AttributePrepender(String attribute, IModel appendModel, String separator) { super(attribute, appendModel, separator); } @Override protected String registerValue(AppendingStringBuffer target, String currentValue, String value, String separator) { sb.append(value); sb.append(separator); sb.append(currentValue); return sb.toString(); } } Hi, I also had the same thoughts when I added the flag (as the patch suggested) but AttributeAppender is a class with just constructor overrides and one method override (#newValue()). If we introduce yet another class for prepend then there is no sense in "the one common parent" because they have nothing to share. Both of them will have the same number of constructors and this override of #newValue(). I agree that now the name AttributeAppende
Re: [WICKET-3552] Is adding another parameter to the constructor required?
Boolean parameters are the bane of software development. I'd urge anyone to reconsider their train of thought when they declare foo(boolean x). It is really bad to have AttributeAppender(boolean appendOrPrepend, ...) if you can have both AttributeAppender() and AttributePrepender() Classes are cheap compared to the cognitive dissonance of the boolean parameter. In any case, the SimpleAttributeModifier, AttributeAppender and AttributePrepender classes are basically stop gap measures to work around issues with AttributeModifier's API. I think that we could do better API wise with three factory methods on AttributeModifier, and deprecate SimpleAttributeModifier and AttributeAppender. I'd also merge the appender/prepender logic into attribute modifier, such that user specializations can make use of them. AttributeModifier.setAttribute(String attribute, IModel value); AttributeModifier.prependAttribute(String attribute, IModel value); AttributeModifier.appendAttribute(String attribute, IModel value); Or perhaps: AttributeModifier.overwrite(String attribute, IModel value); AttributeModifier.prepend(String attribute, IModel value); AttributeModifier.append(String attribute, IModel value); Martijn On Wed, Jun 8, 2011 at 10:18 AM, Martin Grigorov wrote: > Hi Per, > > I see your point. > It is just my opinion (and ticket's reporter) that this additional > boolean parameter to the constructor is adds much less noise than > adding additional 2 classes. > If the name of AttributeAppender is changed to AtrributeAdder (because > we are used that add(obj) appends and add(0, obj) prepends) then it > will be much cleaner. > > Igor's suggestion also sounds OK to me. Then we can either deprecate > AttributeAppender or add AttributePrepender and both of them will just > have constructors that pass the proper mode to AttributeModifier. > > Create a ticket. > > On Wed, Jun 8, 2011 at 10:04 AM, Per Newgro wrote: >> Hi Martin Grigorov, >> >> But i made naming proposals: >> AbstractAttributeRegister >> | | >> AttributeAppender AttributePrepender >> >> My pain in the ... is only that we have now 2 more constructors. This (in my >> opinion) >> really important class should be clear in design and responsibility. >> Another pain could become important if we decide to exchange the default >> values >> for prepend. Wicket did that already in history and it lead to confusion and >> required >> app changes. >> >> The sense in "the one common parent" would be to provide the abstract method >> for value registering. The subclasses would have to implement that. >> >> package org.apache.wicket.behavior; >> >> import org.apache.wicket.AttributeModifier; >> import org.apache.wicket.model.IModel; >> import org.apache.wicket.util.string.AppendingStringBuffer; >> import org.apache.wicket.util.string.Strings; >> >> public class AbstractAttributeRegister extends AttributeModifier >> { >> private static final long serialVersionUID = 1L; >> >> private final String separator; >> >> public AbstractAttributeRegister(String attribute, boolean >> addAttributeIfNotPresent, >> IModel appendModel, String separator) >> { >> this(attribute, addAttributeIfNotPresent, appendModel, separator); >> } >> >> public AbstractAttributeRegister(String attribute, IModel appendModel, >> String separator) >> { >> this(attribute, true, appendModel, separator); >> } >> >> >> /** >> * @see org.apache.wicket.AttributeModifier#newValue(java.lang.String, >> java.lang.String) >> */ >> @Override >> protected String newValue(String currentValue, String appendValue) >> { >> // Shortcut for empty values >> if (Strings.isEmpty(currentValue)) >> { >> return appendValue != null ? appendValue : ""; >> } >> else if (Strings.isEmpty(appendValue)) >> { >> return currentValue; >> } >> >> final AppendingStringBuffer sb = new >> AppendingStringBuffer(currentValue.length() + >> appendValue.length() + separator.length()); >> >> return registerValue(sb, currentValue, appendValue); >> } >> >> protected abstract String registerValue(AppendingStringBuffer target, >> String currentValue, String appendValue); >> } >> >> public class AttributeAppender extends AbstractAttributeRegister >> { >> private static final long serialVersionUID = 1L; >> >> public AttributeAppender(String attribute, boolean >> addAttributeIfNotPresent, >> IModel appendModel, String separator) >> { >> super(attribute, addAttributeIfNotPresent, appendModel, separator); >> } >> >> public AttributeAppender(String attribute, IModel appendModel, String >> separator) >> { >> super(attribute, appendModel, separator); >> } >> >> @Override >> protected String registerValue(AppendingStringBuffer target, String >> currentValue, String value, String separator) >> { >> sb.append(c
Re: [WICKET-3552] Is adding another parameter to the constructor required?
Hi Per, I see your point. It is just my opinion (and ticket's reporter) that this additional boolean parameter to the constructor is adds much less noise than adding additional 2 classes. If the name of AttributeAppender is changed to AtrributeAdder (because we are used that add(obj) appends and add(0, obj) prepends) then it will be much cleaner. Igor's suggestion also sounds OK to me. Then we can either deprecate AttributeAppender or add AttributePrepender and both of them will just have constructors that pass the proper mode to AttributeModifier. Create a ticket. On Wed, Jun 8, 2011 at 10:04 AM, Per Newgro wrote: > Hi Martin Grigorov, > > But i made naming proposals: > AbstractAttributeRegister > | | > AttributeAppender AttributePrepender > > My pain in the ... is only that we have now 2 more constructors. This (in my > opinion) > really important class should be clear in design and responsibility. > Another pain could become important if we decide to exchange the default > values > for prepend. Wicket did that already in history and it lead to confusion and > required > app changes. > > The sense in "the one common parent" would be to provide the abstract method > for value registering. The subclasses would have to implement that. > > package org.apache.wicket.behavior; > > import org.apache.wicket.AttributeModifier; > import org.apache.wicket.model.IModel; > import org.apache.wicket.util.string.AppendingStringBuffer; > import org.apache.wicket.util.string.Strings; > > public class AbstractAttributeRegister extends AttributeModifier > { > private static final long serialVersionUID = 1L; > > private final String separator; > > public AbstractAttributeRegister(String attribute, boolean > addAttributeIfNotPresent, > IModel appendModel, String separator) > { > this(attribute, addAttributeIfNotPresent, appendModel, separator); > } > > public AbstractAttributeRegister(String attribute, IModel appendModel, > String separator) > { > this(attribute, true, appendModel, separator); > } > > > /** > * @see org.apache.wicket.AttributeModifier#newValue(java.lang.String, > java.lang.String) > */ > @Override > protected String newValue(String currentValue, String appendValue) > { > // Shortcut for empty values > if (Strings.isEmpty(currentValue)) > { > return appendValue != null ? appendValue : ""; > } > else if (Strings.isEmpty(appendValue)) > { > return currentValue; > } > > final AppendingStringBuffer sb = new > AppendingStringBuffer(currentValue.length() + > appendValue.length() + separator.length()); > > return registerValue(sb, currentValue, appendValue); > } > > protected abstract String registerValue(AppendingStringBuffer target, > String currentValue, String appendValue); > } > > public class AttributeAppender extends AbstractAttributeRegister > { > private static final long serialVersionUID = 1L; > > public AttributeAppender(String attribute, boolean > addAttributeIfNotPresent, > IModel appendModel, String separator) > { > super(attribute, addAttributeIfNotPresent, appendModel, separator); > } > > public AttributeAppender(String attribute, IModel appendModel, String > separator) > { > super(attribute, appendModel, separator); > } > > @Override > protected String registerValue(AppendingStringBuffer target, String > currentValue, String value, String separator) > { > sb.append(currentValue); > sb.append(separator); > sb.append(value); > return sb.toString(); > } > } > > public class AttributePrepender extends AbstractAttributeRegister > { > private static final long serialVersionUID = 1L; > > public AttributePrepender(String attribute, boolean > addAttributeIfNotPresent, > IModel appendModel, String separator) > { > super(attribute, addAttributeIfNotPresent, appendModel, separator); > } > > public AttributePrepender(String attribute, IModel appendModel, String > separator) > { > super(attribute, appendModel, separator); > } > > @Override > protected String registerValue(AppendingStringBuffer target, String > currentValue, String value, String separator) > { > sb.append(value); > sb.append(separator); > sb.append(currentValue); > return sb.toString(); > } > } > > > >> Hi, >> >> I also had the same thoughts when I added the flag (as the patch >> suggested) but AttributeAppender is a class with just constructor >> overrides and one method override (#newValue()). If we introduce yet >> another class for prepend then there is no sense in "the one common >> parent" because they have nothing to share. Both of them will have the >> same number of constructors and this override of #newValue(). >> >> I agree that now the name At
Re: wicket-dnd not working on IE9 and only partially on IE8
Hi Sven, Thanks for your reply. I've tested wicket-dnd on windows Vista, using IE9 and that's when the problem occurs. The problem of the on drop functionality not displaying the object dropped, described in my previous post occurs on IE8 under both windows vista and windows xp. Wicket-dnd works fine in any other web browser I have tried. As requested, here is the version I am using of wicket-dnd, extracted from my pom file: wicket-dnd wicket-dnd 0.4-SNAPSHOT compile On repository section I have the following: wicket-dnd Wicket-dnd Repository http://wicket-dnd.googlecode.com/svn/repo I will try to recreate the problem described above in a simple example, once I know what triggers it. I don't want to speculate as to the cause. All I can say is that it's the way I make use of wicket-dnd that causes this. So it must be the way I coded repeating views or something like that. I'll post my code as soon as I get the chance. Thanks, once more, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-dnd-not-working-on-IE9-and-only-partially-on-IE8-tp3580258p3581931.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [WICKET-3552] Is adding another parameter to the constructor required?
why not roll this into attributemodifier and have mode { replace, append, prepand } where replace is how the modifier works now... -igor On Wed, Jun 8, 2011 at 12:07 AM, Martin Grigorov wrote: > Hi, > > I also had the same thoughts when I added the flag (as the patch > suggested) but AttributeAppender is a class with just constructor > overrides and one method override (#newValue()). If we introduce yet > another class for prepend then there is no sense in "the one common > parent" because they have nothing to share. Both of them will have the > same number of constructors and this override of #newValue(). > > I agree that now the name AttributeAppender is not the best but I > cannot find a better one and even if we find it then we will have to > rename this class which I think is used a lot > > On Wed, Jun 8, 2011 at 8:53 AM, Per Newgro wrote: >> Hi, >> >> i've traced changes in 1.5-RC4.2. Found the issue 3552 [ >> https://issues.apache.org/jira/browse/WICKET-3552 ]. If i'm not >> completely in the wood the solution breaks the >> SingleResponsibilityPrinciple by adding a flag to the constructor >> which negates the class behavior. >> Wouldn't it be more clear and reusable if we had another >> AttributePrepender which acts like the AttributeAppender. >> Both could extend the base-class AbstractAttributeRegister or >> something. Then only the different part of the newValue method has >> to be implemented by the concrete class. >> >> I only ask because if 1.5 is out it will be hard to exchange because >> many apps will be upgraded and feature is maybe used :-). >> >> What do you think? >> Cheers >> Per >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > > > -- > Martin Grigorov > jWeekend > Training, Consulting, Development > http://jWeekend.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: [WICKET-3552] Is adding another parameter to the constructor required?
Hi Martin Grigorov, But i made naming proposals: AbstractAttributeRegister | | AttributeAppender AttributePrepender My pain in the ... is only that we have now 2 more constructors. This (in my opinion) really important class should be clear in design and responsibility. Another pain could become important if we decide to exchange the default values for prepend. Wicket did that already in history and it lead to confusion and required app changes. The sense in "the one common parent" would be to provide the abstract method for value registering. The subclasses would have to implement that. package org.apache.wicket.behavior; import org.apache.wicket.AttributeModifier; import org.apache.wicket.model.IModel; import org.apache.wicket.util.string.AppendingStringBuffer; import org.apache.wicket.util.string.Strings; public class AbstractAttributeRegister extends AttributeModifier { private static final long serialVersionUID = 1L; private final String separator; public AbstractAttributeRegister(String attribute, boolean addAttributeIfNotPresent, IModel appendModel, String separator) { this(attribute, addAttributeIfNotPresent, appendModel, separator); } public AbstractAttributeRegister(String attribute, IModel appendModel, String separator) { this(attribute, true, appendModel, separator); } /** * @see org.apache.wicket.AttributeModifier#newValue(java.lang.String, java.lang.String) */ @Override protected String newValue(String currentValue, String appendValue) { // Shortcut for empty values if (Strings.isEmpty(currentValue)) { return appendValue != null ? appendValue : ""; } else if (Strings.isEmpty(appendValue)) { return currentValue; } final AppendingStringBuffer sb = new AppendingStringBuffer(currentValue.length() + appendValue.length() + separator.length()); return registerValue(sb, currentValue, appendValue); } protected abstract String registerValue(AppendingStringBuffer target, String currentValue, String appendValue); } public class AttributeAppender extends AbstractAttributeRegister { private static final long serialVersionUID = 1L; public AttributeAppender(String attribute, boolean addAttributeIfNotPresent, IModel appendModel, String separator) { super(attribute, addAttributeIfNotPresent, appendModel, separator); } public AttributeAppender(String attribute, IModel appendModel, String separator) { super(attribute, appendModel, separator); } @Override protected String registerValue(AppendingStringBuffer target, String currentValue, String value, String separator) { sb.append(currentValue); sb.append(separator); sb.append(value); return sb.toString(); } } public class AttributePrepender extends AbstractAttributeRegister { private static final long serialVersionUID = 1L; public AttributePrepender(String attribute, boolean addAttributeIfNotPresent, IModel appendModel, String separator) { super(attribute, addAttributeIfNotPresent, appendModel, separator); } public AttributePrepender(String attribute, IModel appendModel, String separator) { super(attribute, appendModel, separator); } @Override protected String registerValue(AppendingStringBuffer target, String currentValue, String value, String separator) { sb.append(value); sb.append(separator); sb.append(currentValue); return sb.toString(); } } Hi, I also had the same thoughts when I added the flag (as the patch suggested) but AttributeAppender is a class with just constructor overrides and one method override (#newValue()). If we introduce yet another class for prepend then there is no sense in "the one common parent" because they have nothing to share. Both of them will have the same number of constructors and this override of #newValue(). I agree that now the name AttributeAppender is not the best but I cannot find a better one and even if we find it then we will have to rename this class which I think is used a lot On Wed, Jun 8, 2011 at 8:53 AM, Per Newgro wrote: Hi, i've traced changes in 1.5-RC4.2. Found the issue 3552 [ https://issues.apache.org/jira/browse/WICKET-3552 ]. If i'm not completely in the wood the solution breaks the SingleResponsibilityPrinciple by adding a flag to the constructor which negates the class behavior. Wouldn't it be more clear and reusable if we had another AttributePrepender which acts like the AttributeAppender. Both could extend the base-class AbstractAttributeRegister or something. Then only the different part of the newValue method has to be implemented by the concrete class. I only ask because if 1.5 is out
Re: WicketRuntimeException
The stack trace shows the page that is holding the lock as well Martijn On Wed, Jun 8, 2011 at 7:20 AM, Martin Grigorov wrote: > On Wed, Jun 8, 2011 at 7:00 AM, Jeffrey Schneller > wrote: >> I have started to see more and more of the following exception when >> users are using the wicket app. >> >> >> >> org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap >> null is still locked by: Thread[TP-Processor24,5,main], giving up trying >> to get the page for path: 4:products:0:prodBuyLink >> >> >> >> If my understanding is right, it is a timeout that is occurring because >> the app is still processing for the page that is trying to be viewed. >> Is this correct? Any ideas on how to debug or solve? What are some >> common reasons for this type of exception? > > Correct. You can dump the thread's state with tools like jconsole or > on unix machines with "kill -3 pid". > Making several dumps you will see the thread that is "stuck". >> >> >> >> >> >> > > > > -- > Martin Grigorov > jWeekend > Training, Consulting, Development > http://jWeekend.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Gamboa Project
Very nice, Bruno! Just one thing: > Thanks to Wicket 1.5 and the auto resource path URL feature, it is even > better to have separated HTML+css+js from the Java/Scala code. Which feature exactly do you mean ? On Wed, Jun 8, 2011 at 3:22 AM, Bruno Borges wrote: > Hi everyone, > > I've been working on what I call the Gamboa Project for a couple of days > and now the project is ready and published. > > It is a Maven archetype for rapid web application development. It > combines well-know technologies: > > - Scala > - Apache Wicket > - MongoDB > - Spring Framework > - Velocity > - HTML5+jQuery > > The purpose of this project is to give developers a quick start for Web 2.0 > applications based on NoSQL. > Plans for another archetype for SQL does exist though. > > https://github.com/brunoborges/gamboa-project/ > > Also, this project aims a common scenario where web designers build > prototypes and give them to developers. > With Gamboa, all the prototype goes to *layout* folder and page classes goes > to *code/pages*. > Thanks to Wicket 1.5 and the auto resource path URL feature, it is even > better to have separated HTML+css+js from the Java/Scala code. > > I also plan to build (with it) its own website at www.gamboa-project.org. > > If anyone is interested on this, please take a look. > Feedbacks are welcome. > > Thank you, > *Bruno Borges* > www.brunoborges.com.br > +55 21 76727099 > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [WICKET-3552] Is adding another parameter to the constructor required?
Hi, I also had the same thoughts when I added the flag (as the patch suggested) but AttributeAppender is a class with just constructor overrides and one method override (#newValue()). If we introduce yet another class for prepend then there is no sense in "the one common parent" because they have nothing to share. Both of them will have the same number of constructors and this override of #newValue(). I agree that now the name AttributeAppender is not the best but I cannot find a better one and even if we find it then we will have to rename this class which I think is used a lot On Wed, Jun 8, 2011 at 8:53 AM, Per Newgro wrote: > Hi, > > i've traced changes in 1.5-RC4.2. Found the issue 3552 [ > https://issues.apache.org/jira/browse/WICKET-3552 ]. If i'm not > completely in the wood the solution breaks the > SingleResponsibilityPrinciple by adding a flag to the constructor > which negates the class behavior. > Wouldn't it be more clear and reusable if we had another > AttributePrepender which acts like the AttributeAppender. > Both could extend the base-class AbstractAttributeRegister or > something. Then only the different part of the newValue method has > to be implemented by the concrete class. > > I only ask because if 1.5 is out it will be hard to exchange because > many apps will be upgraded and feature is maybe used :-). > > What do you think? > Cheers > Per > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org