Re: javascript calls to a remote jvm for a wicket component
You could try to use a [i]frame on IIS and a single page (panel replacement/ajax) solution? Martijn On Wed, Feb 17, 2010 at 7:53 PM, Robert Sandoval rsandoval@gmail.com wrote: Hi, sorry I'm new to wicket and was wondering if the following is possible. I am stuck with putting up a webapp on IIS and I am only able to use HTML/javascript. We were planning on implementing services in JBoss and creating restfull services to send data to the front end. I don't really want to build the front end in IIS because we don't have control over the box. Updating it will be a time consuming process. I wanted to know if we could have the javascript call a Wicket Component (to display...say a Panel) with all that I care about. This would keep the web page pretty much static while we could change the content on the JBoss end. I have been playing around with wicketAjaxGet that is provided in wicket-ajax.js but haven't been able to get it to work. Has anyone done anything similar? If not I am open to suggestions. If someone knows how to do this and can provide a small example that would be great. -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.4 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Timeouts when requesting resources from a jar
Greetings, This is kind of an odd problem so I will do my best to explain it. First our environment: We are running a wicket 1.4 app inside Tomcat Tomcat is front-ended by Apache 2.2 using mod_proxy_http so we are talking to the Http 1.1 connector in Tomcat Our Http 1.1 connector has a connectionTimeout parameter of 20 seconds (I believe this is the default it is shipped with) We are using the Wicket DateTextField which includes the use of some yui css and javascript Now for the problem: Whenever we load a page with a DateTextField on it the loading takes a very long time. I have been able to trace the problem to the loading of all of the js/css elements that are used by the DateTextField. Each element takes exactly 20 seconds to load (again this is the timeout on Tomcat's Http 1.1 connector) which means in total it can take over minute for the DateTextField to be usable. When I change the connectionTimeout parameter to something smaller like 2 seconds it takes each js/css element exactly 2 seconds to load. This lead me to believe that the loading of these files is timing out. Tracking it down further it looks like the timeout is coming on the java.net.SocketInputStream when it performs a read. I have tried moving some of these files out of the jar they came with and it seems to reduce the loading time to tens of milliseconds so it seems like the problem has to do with the fact tomcat is being asked to serve a file out of a jar. Now I realize that this is not a bug in Wicket but I have exhausted Google in a search for someone else who has had this problem. Has anyone run into problems using the DateTextField component when running right off of an Http 1.1 connector. I should also mention that when we started with the AJP connector in tomcat and the problem doesnt appear, however we have had reliability issues with AJP and it occasionally drops packets so we have been asked to switch to the Http 1.1 connector. Thanks, Adam - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Timeouts when requesting resources from a jar
Hi, this sounds like a missing content-length header line in combination with a keep-alive header line in the response. In such a case the connection must be kept open until all data is sent but the receiving instance (your apache proxy) does not know when to stop the transmission and the timeout stops the transmission. Best Regards, Ilja Pavkovic Am Donnerstag, 18. Februar 2010 01:25:24 schrieb Adam Bender: Greetings, This is kind of an odd problem so I will do my best to explain it. First our environment: We are running a wicket 1.4 app inside Tomcat Tomcat is front-ended by Apache 2.2 using mod_proxy_http so we are talking to the Http 1.1 connector in Tomcat Our Http 1.1 connector has a connectionTimeout parameter of 20 seconds (I believe this is the default it is shipped with) We are using the Wicket DateTextField which includes the use of some yui css and javascript Now for the problem: Whenever we load a page with a DateTextField on it the loading takes a very long time. I have been able to trace the problem to the loading of all of the js/css elements that are used by the DateTextField. Each element takes exactly 20 seconds to load (again this is the timeout on Tomcat's Http 1.1 connector) which means in total it can take over minute for the DateTextField to be usable. When I change the connectionTimeout parameter to something smaller like 2 seconds it takes each js/css element exactly 2 seconds to load. This lead me to believe that the loading of these files is timing out. Tracking it down further it looks like the timeout is coming on the java.net.SocketInputStream when it performs a read. I have tried moving some of these files out of the jar they came with and it seems to reduce the loading time to tens of milliseconds so it seems like the problem has to do with the fact tomcat is being asked to serve a file out of a jar. Now I realize that this is not a bug in Wicket but I have exhausted Google in a search for someone else who has had this problem. Has anyone run into problems using the DateTextField component when running right off of an Http 1.1 connector. I should also mention that when we started with the AJP connector in tomcat and the problem doesnt appear, however we have had reliability issues with AJP and it occasionally drops packets so we have been asked to switch to the Http 1.1 connector. Thanks, Adam - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- binaere bauten gmbh · tempelhofer ufer 1a · 10961 berlin +49 · 171 · 9342 465 Handelsregister: HRB 115854 - Amtsgericht Charlottenburg Geschäftsführer: Dipl.-Inform. Ilja Pavkovic, Dipl.-Inform. Jost Becker - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: TimePicker component?
It is quite easy to use dojo components with Wicket, especially with the declarative approach. Here is a behavior that I wrote few days ago (so it is not bug free) that could be used for most of the dijit.form.** components: package com.mycompany.dojo; import java.util.Locale; import org.apache.wicket.Request; import org.apache.wicket.RequestCycle; import org.apache.wicket.WicketRuntimeException; import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.markup.ComponentTag; import org.apache.wicket.markup.html.IHeaderResponse; import org.apache.wicket.markup.html.form.FormComponent; import org.apache.wicket.util.convert.IConverter; import org.apache.wicket.util.value.IValueMap; @SuppressWarnings(serial) public class DojoOnChangeBehaviorT extends AbstractDefaultAjaxBehavior { private static final String parameterName = dojoOnChangeValue; private final String dojoType; public DojoOnChangeBehavior(String dojoType) { this.dojoType = dojoType; } @SuppressWarnings(unchecked) @Override protected void onBind() { super.onBind(); if (false == getComponent() instanceof FormComponent) { throw new WicketRuntimeException(DojoOnChangeBehavior.class.getName()+ can be used only with implementations of +FormComponent.class.getName()); } } @Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.renderJavascript(String.format(dojo.require('%s'), dojoType), dojo.require.+dojoType); } @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); IValueMap attributes = tag.getAttributes(); attributes.put(dojoType, dojoType); CharSequence callbackUrl = getCallbackUrl(false); String dojoCallbackUrl = wicketAjaxGet('+callbackUrl ++parameterName+='+arguments[0]); // String dojoCallbackUrl = alert(arguments[0]); attributes.put(onChange, dojoCallbackUrl); } @Override protected void respond(AjaxRequestTarget target) { final Request request = RequestCycle.get().getRequest(); final String value = request.getParameter(parameterName); onChange(target, value); } @SuppressWarnings(unchecked) protected void onChange(final AjaxRequestTarget target, final String selectedValue) { final FormComponentT formComponent = (FormComponentT) getComponent(); IConverter converter = formComponent.getConverter(formComponent.getType()); if (converter != null) { Locale locale = formComponent.getLocale(); Object convertedObject = converter.convertToObject(selectedValue, locale); formComponent.setConvertedInput((T) convertedObject); } else { formComponent.setConvertedInput((T) selectedValue); } formComponent.updateModel(); } } And the usage is: TextFieldString startDate = new TextFieldString(startDate, new PropertyModelString(trigger, startDate)); add(startDate); startDate.add(new DojoOnChangeBehaviorString(dijit.form.DateTextBox)); or DropDownChoiceContentType contentTypesSelect = new DropDownChoiceContentType(contentTypes, new PropertyModelContentType(content, selectedType), content.getTypes()); contentTypesSelect..add(new DojoOnChangeBehaviorContentType(dijit.form.FilteringSelect)); (here you need a registered converter for 'ContentType' class) On Wed, 2010-02-17 at 10:17 -0600, Josh Chappelle wrote: I would also like to know the answer to this. The only reason our team hasn't moved to 1.4 is because we have dependencies on some dojo projects but none of the ones we use work in 1.4. Josh -Original Message- From: Mauro Ciancio [mailto:maurocian...@gmail.com] Sent: Wednesday, February 17, 2010 9:27 AM To: Wicket Mailing List Subject: TimePicker component? Hello everyone, I'm looking for a TimePicker component. I searched in the list and found the dojo time picker from wicket-stuff but isn't working with wicket 1.4.x. Throws an exception when the component is being rendered. Is there any other component? Is any dojo integration compatible with 1.4.x? Thanks in advance. Cheers! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands,
RE: best way to detect session termination
Ilja, thanks for your reply. If I create a service class like the one below, my _userDao object is always null. This _userDao works perfectly in other parts of my app. Do I need to inject the dao in a special way? I think the integration into spring is the problem, because I don't know where to place the corresponding part in the config/xml files. As I said, my knowledge of spring is limited. My class looks like this: @Service @Transactional public class SessionDestroyedService { @ Autowired private UserDao _userDao; public void forceLogout(String sessionId) { if (_userDao == null) System.out.println(SessionDestroyedService.forceLogout(): _userDao is NULL); else { System.out.println(SessionDestroyedService.forceLogout(): _userDao is OK); User user = _userDao.getBySessionId(sessionId); if (user != null) { // do the work here... } } } } Andreas -Original Message- From: Ilja Pavkovic [mailto:ilja.pavko...@binaere-bauten.de] Sent: Wednesday, February 17, 2010 5:38 PM To: users@wicket.apache.org Subject: Re: best way to detect session termination Hi, create a service class marked with Annotation @Transactional and manage it with spring. Calls to this function will have get a session from the spring context. Spring will open a session before calling any function on this service and close the session afterwards. @Service @Transactional public class MyService { @Autowired private MyDao dao; public destroySession(String sessionId) { myDao.deleteMySessionById(sessionId); } } Best Regards, Ilja Pavkovic Am Mittwoch, 17. Februar 2010 13:24:11 schrieb Andreas Lüdtke: Vineet, I'm now storing the session id in the user record. But now I have another problem, because hibernate tells me now in sessionDestroy(): org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here I'm using spring to inject my dao. I also tried to use the dao in my HttpSessionListener which is configured in web.xml, but that prevents my app from being started by Tomcat. Next I did was to create a manual created hibernate session, but that raised other problems like a missing hibernate.hbm.xml file and I don't want to configure that manually... Does somebody see another way to access my user data, or am I doing something stupid? Andreas -Original Message- From: vineet semwal [mailto:vineetsemwal1...@gmail.com] Sent: Tuesday, February 16, 2010 2:15 PM To: users@wicket.apache.org; sam.lued...@t-online.de Subject: Re: best way to detect session termination can't you simply do that in webapplication.sessiondestroy(String sessionid), you can store the sessionid when user logs in and on sessiondestroyed ,search the user by this sessionid , and change whatever in user object and then persist it.. On Tue, Feb 16, 2010 at 6:23 PM, Andreas Lüdtke sam.lued...@t-online.dewrote: I studied the classes HttpSessionBindingListener and AbstractHttpSessionStore as you noted, but I think I'll still have no link between the SessionId from the HTTPSession and my own Session. Maybe I'm missing something or I don't see the wood among all the trees as we say in Germany... Andreas -Original Message- From: Eelco Hillenius [mailto:eelco.hillen...@gmail.com] Sent: Monday, February 15, 2010 7:08 PM To: sam.lued...@t-online.de Cc: users@wicket.apache.org Subject: Re: best way to detect session termination You could use a HttpSessionBindingListener like Wicket does internally (see AbstractHttpSessionStore). Or as a hack store references to the session objects in the session listener. That's the easy fix, but doesn't scale if you need session replication (unless maybe you use e.g. Terracotta). Eelco On Sun, Feb 14, 2010 at 4:36 AM, Andreas Lüdtke sam.lued...@t-online.de wrote: Hi Eelco, thanks for the hint. Now I can detect the end of a session. Unfortunately I can't access my own wicket session in that sessionDestroyed() method in order to get the info about the connected user. I've got ther error message java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle. Do you know how I can achieve this? Andreas -Original Message- From: Eelco Hillenius [mailto:eelco.hillen...@gmail.com] Sent: Saturday, February 13, 2010 7:02 PM To: users@wicket.apache.org; sam.lued...@t-online.de
Re: best way to detect session termination
Hi, _userDao shouldn't be null if you annotate it in your applicationContext.xml and grep it out of the ApplicationContext, e.g. applicationContext.getBean(sessionDestroyedService); otherwise spring would have already failed as it was not able to autowire _userDao. Best Regards, Ilja Pavkovic Am Donnerstag, 18. Februar 2010 12:52:46 schrieb Andreas Lüdtke: Ilja, thanks for your reply. If I create a service class like the one below, my _userDao object is always null. This _userDao works perfectly in other parts of my app. Do I need to inject the dao in a special way? I think the integration into spring is the problem, because I don't know where to place the corresponding part in the config/xml files. As I said, my knowledge of spring is limited. My class looks like this: @Service @Transactional public class SessionDestroyedService { @ Autowired private UserDao _userDao; public void forceLogout(String sessionId) { if (_userDao == null) System.out.println(SessionDestroyedService.forceLogout(): _userDao is NULL); else { System.out.println(SessionDestroyedService.forceLogout(): _userDao is OK); User user = _userDao.getBySessionId(sessionId); if (user != null) { // do the work here... } } } } Andreas -Original Message- From: Ilja Pavkovic [mailto:ilja.pavko...@binaere-bauten.de] Sent: Wednesday, February 17, 2010 5:38 PM To: users@wicket.apache.org Subject: Re: best way to detect session termination Hi, create a service class marked with Annotation @Transactional and manage it with spring. Calls to this function will have get a session from the spring context. Spring will open a session before calling any function on this service and close the session afterwards. @Service @Transactional public class MyService { @Autowired private MyDao dao; public destroySession(String sessionId) { myDao.deleteMySessionById(sessionId); } } Best Regards, Ilja Pavkovic Am Mittwoch, 17. Februar 2010 13:24:11 schrieb Andreas Lüdtke: Vineet, I'm now storing the session id in the user record. But now I have another problem, because hibernate tells me now in sessionDestroy(): org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here I'm using spring to inject my dao. I also tried to use the dao in my HttpSessionListener which is configured in web.xml, but that prevents my app from being started by Tomcat. Next I did was to create a manual created hibernate session, but that raised other problems like a missing hibernate.hbm.xml file and I don't want to configure that manually... Does somebody see another way to access my user data, or am I doing something stupid? Andreas -Original Message- From: vineet semwal [mailto:vineetsemwal1...@gmail.com] Sent: Tuesday, February 16, 2010 2:15 PM To: users@wicket.apache.org; sam.lued...@t-online.de Subject: Re: best way to detect session termination can't you simply do that in webapplication.sessiondestroy(String sessionid), you can store the sessionid when user logs in and on sessiondestroyed ,search the user by this sessionid , and change whatever in user object and then persist it.. On Tue, Feb 16, 2010 at 6:23 PM, Andreas Lüdtke sam.lued...@t-online.dewrote: I studied the classes HttpSessionBindingListener and AbstractHttpSessionStore as you noted, but I think I'll still have no link between the SessionId from the HTTPSession and my own Session. Maybe I'm missing something or I don't see the wood among all the trees as we say in Germany... Andreas -Original Message- From: Eelco Hillenius [mailto:eelco.hillen...@gmail.com] Sent: Monday, February 15, 2010 7:08 PM To: sam.lued...@t-online.de Cc: users@wicket.apache.org Subject: Re: best way to detect session termination You could use a HttpSessionBindingListener like Wicket does internally (see AbstractHttpSessionStore). Or as a hack store references to the session objects in the session listener. That's the easy fix, but doesn't scale if you need session replication (unless maybe you use e.g. Terracotta). Eelco On Sun, Feb 14, 2010 at 4:36 AM, Andreas Lüdtke sam.lued...@t-online.de wrote: Hi Eelco, thanks for the hint. Now I can detect the end of a session. Unfortunately I can't access my own wicket session in that
Re: TimePicker component?
Martin: On Thu, Feb 18, 2010 at 4:54 AM, Martin Grigorov mcgreg...@e-card.bg wrote: It is quite easy to use dojo components with Wicket, especially with the declarative approach. Here is a behavior that I wrote few days ago (so it is not bug free) that could be used for most of the dijit.form.** components: Thanks you, I'll try how it works. Cheers! -- Mauro Ciancio maurociancio at gmail dot com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Ajax and OpenSessionInViewFilter problems
Hi All, As the subject reads, I'm having some problems with Ajax and the OpenSessionInViewFilter. Here's my basic setup: I've got a page with some address info, such as street/city/zipcode. Let's call the current value of these fields V1. There is also an ajax link to open a modal panel that allows the user to look up street/city info based on the zipcode. When the modal panel opens the info V1 is passed on to the modal panel as initial value. Let's say here the user enters new info and a street/city is found, we'll call this info V2. The user then presses the submit button on the modal panel and indeed V2 is now shown on the main page. However, when I now click the ajax link to open the modal panel again, the user get's shown V1 in the modal panel as initial filling. When finally submitting the page V2 is persisted, so the information is being retained somewhere. I have debugged the application and I see the setters of my domain object being called. Also when debugging however I see that the load() method of the LoadableDetachableModel is being called when I hit the ajax link, so it seems like a new version of the object is being retrieved from the database. I thought that's what the OpenSessionInViewFilter was for, to allow for multiple requests in your view without Hibernate closing/opening the session each time and retrieving fresh copies of your objects. Here is some relevant code: OpenSessionInView setup in web.xml: filter filter-nameopensessioninview/filter-name filter-class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter /filter-class init-param param-namesingleSession/param-name param-valuetrue/param-value /init-param /filter Submit link on my modal panel: searchResultsHolder.add(new AjaxSubmitLink(selectMatch) { @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { Address address = addressModel.getObject(); address.setZipcode(foundZipcode.getZipcode()); address.setHouseNr(foundZipcode.getHouseNr()); address.setStreet(foundZipcode.getStreet().getStreetName()); address.setCity(foundZipcode.getCity().getCityName()); address.setCountry(Country.NL); address.setAddressValidated(true); for (Component component : updateList) { target.addComponent(component); } modalWindow.close(target); } }); The LoadableDetachableModel used (and is being called when I hit the ajax link): final IModelARF mergedModel = new LoadableDetachableModelARF() { @Override protected ARF load() { return arfService.load(arfId); } }; Many thanks for any help! Kind regards, Jonck
tinymmce with wicket 1.4.6
tinymce I repackaged it with latest java script from tinymce to work properly.It was working fine with 1.4.1 , I updated my wicket to 1.4.6 none of additional plugins from tinymce are working ,please tell me tinymce compatibility with wicket 1.4.6 ?
RE: Ajax and OpenSessionInViewFilter problems
Hi All, Follow-up to my own post. I found the following here: http://old.nabble.com/Wicket---No-Serializable-objects-Web-application-t d19351608.html Quote: However , there is a problem if you use loadabledetachable with AJAX requests on your page. Model.detach() is called on every request, which causes your object to be retrieved from database on the next Model.getObject() call. This means you lose all changes on your bound domain obect on every ajax request. I found to solutions to this, and i like neither of them: a) use DTOs, which means a lot of code duplication. b) write the current object state to the database on every detach, which means you might store objects in an incomplete state, before the user explicitly tells the application to store what she or hehas entered. If anybody has a nicer solution to this, i'd love to hear about it. Option b) is definitely a no-go, so it seems I'll have to use DTO's then. If someone knows of a nicer solution I would also love to hear about it. For now I guess I'll go the DTO road. Thanks, Jonck -Original Message- From: Kogel, Jonck-van-der [mailto:jonck-van-der.ko...@bmw.nl] Sent: donderdag 18 februari 2010 14:30 To: users@wicket.apache.org Subject: Ajax and OpenSessionInViewFilter problems Hi All, As the subject reads, I'm having some problems with Ajax and the OpenSessionInViewFilter. Here's my basic setup: I've got a page with some address info, such as street/city/zipcode. Let's call the current value of these fields V1. There is also an ajax link to open a modal panel that allows the user to look up street/city info based on the zipcode. When the modal panel opens the info V1 is passed on to the modal panel as initial value. Let's say here the user enters new info and a street/city is found, we'll call this info V2. The user then presses the submit button on the modal panel and indeed V2 is now shown on the main page. However, when I now click the ajax link to open the modal panel again, the user get's shown V1 in the modal panel as initial filling. When finally submitting the page V2 is persisted, so the information is being retained somewhere. I have debugged the application and I see the setters of my domain object being called. Also when debugging however I see that the load() method of the LoadableDetachableModel is being called when I hit the ajax link, so it seems like a new version of the object is being retrieved from the database. I thought that's what the OpenSessionInViewFilter was for, to allow for multiple requests in your view without Hibernate closing/opening the session each time and retrieving fresh copies of your objects. Here is some relevant code: OpenSessionInView setup in web.xml: filter filter-nameopensessioninview/filter-name filter-class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter /filter-class init-param param-namesingleSession/param-name param-valuetrue/param-value /init-param /filter Submit link on my modal panel: searchResultsHolder.add(new AjaxSubmitLink(selectMatch) { @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { Address address = addressModel.getObject(); address.setZipcode(foundZipcode.getZipcode()); address.setHouseNr(foundZipcode.getHouseNr()); address.setStreet(foundZipcode.getStreet().getStreetName()); address.setCity(foundZipcode.getCity().getCityName()); address.setCountry(Country.NL); address.setAddressValidated(true); for (Component component : updateList) { target.addComponent(component); } modalWindow.close(target); } }); The LoadableDetachableModel used (and is being called when I hit the ajax link): final IModelARF mergedModel = new LoadableDetachableModelARF() { @Override protected ARF load() { return arfService.load(arfId); } }; Many thanks for any help! Kind regards, Jonck - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Slides of Wicket and Struts 2
I gather some ideas last week and today I sorted something more coherent. I will present to technical, Java developer of Java user group in Milano. I wrote something like a skeleton for the presentation, would love feedback from everyone I will have 25-30 minutes, plus questions. I do not focus on comparison, I do not have enough skill on any other web framework. Maybe my talk will be followed by one about GWT. So give me some argument for comparison! :) Here we go, my work in progress: http://docs.google.com/View?id=dhccq8r9_73c3hs85g2 -- Daniele Dellafiore http://danieledellafiore.net
Re: Slides of Wicket and Struts 2
Hi! Yeah, you definitely need to discuss the mash-up approach with wicket: http://code.google.com/p/wicket-mashup/ ** Martin 2010/2/18 Daniele Dellafiore ilde...@gmail.com: I gather some ideas last week and today I sorted something more coherent. I will present to technical, Java developer of Java user group in Milano. I wrote something like a skeleton for the presentation, would love feedback from everyone I will have 25-30 minutes, plus questions. I do not focus on comparison, I do not have enough skill on any other web framework. Maybe my talk will be followed by one about GWT. So give me some argument for comparison! :) Here we go, my work in progress: http://docs.google.com/View?id=dhccq8r9_73c3hs85g2 -- Daniele Dellafiore http://danieledellafiore.net - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
301 redirect
Hi friends, I need to do an 301 redirect in place of 302. I try, but still I get 302: RedirectRequestTarget target = new RedirectRequestTarget(url) { @Override public void respond(RequestCycle requestCycle) { WebResponse response = (WebResponse) requestCycle .getResponse(); response.reset(); response.getHttpServletResponse().setStatus( HttpServletResponse.SC_MOVED_PERMANENTLY); response.redirect(url); } }; getRequestCycle().setRequestTarget(target); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: 301 redirect
http://old.nabble.com/301-Redirect-td27030778.html 2010/2/18 Matías G. Tito mt...@zauber.com.ar: Hi friends, I need to do an 301 redirect in place of 302. I try, but still I get 302: RedirectRequestTarget target = new RedirectRequestTarget(url) { @Override public void respond(RequestCycle requestCycle) { WebResponse response = (WebResponse) requestCycle .getResponse(); response.reset(); response.getHttpServletResponse().setStatus( HttpServletResponse.SC_MOVED_PERMANENTLY); response.redirect(url); } }; getRequestCycle().setRequestTarget(target); - 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: 301 redirect
Yes, I test it and works but I feel that is not a real 301 :p Martin Makundi wrote: http://old.nabble.com/301-Redirect-td27030778.html 2010/2/18 Matías G. Tito mt...@zauber.com.ar: Hi friends, I need to do an 301 redirect in place of 302. I try, but still I get 302: RedirectRequestTarget target = new RedirectRequestTarget(url) { @Override public void respond(RequestCycle requestCycle) { WebResponse response = (WebResponse) requestCycle .getResponse(); response.reset(); response.getHttpServletResponse().setStatus( HttpServletResponse.SC_MOVED_PERMANENTLY); response.redirect(url); } }; getRequestCycle().setRequestTarget(target); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: 301 redirect
It's real for sure. You can test it with google admin tools if you like ;) ** Martin 2010/2/18 Matías G. Tito mt...@zauber.com.ar: Yes, I test it and works but I feel that is not a real 301 :p Martin Makundi wrote: http://old.nabble.com/301-Redirect-td27030778.html 2010/2/18 Matías G. Tito mt...@zauber.com.ar: Hi friends, I need to do an 301 redirect in place of 302. I try, but still I get 302: RedirectRequestTarget target = new RedirectRequestTarget(url) { �...@override public void respond(RequestCycle requestCycle) { WebResponse response = (WebResponse) requestCycle .getResponse(); response.reset(); response.getHttpServletResponse().setStatus( HttpServletResponse.SC_MOVED_PERMANENTLY); response.redirect(url); } }; getRequestCycle().setRequestTarget(target); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Create Wikcet Filter
I'm loking for creatting a basic wicket filter for / - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Behavior does not work when visibility is changed from false to true
I have a TextField with an AjaxFormSubmitBehavior attached to it. The behavior works fine when the page is loaded with the TextField visible but does not work if the page is loaded with it not visible and then made visible with an ajax call. I can see everything in the ajax response including the head js. The head js has a function that gets called by the TextFields onkeypress event before the wicket ajax is called. Firebug says it can't find the function, but it is in the ajax response. There is no js in this behavior that is associated with the page loading. What do I need to do to make this behavior work after visibility is changed from false to true? -- Thanks, Warren Bell - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
(Form) Use two TextFields for one object property?
Hi List, the following may looked flawed, so I'm happy to hear your suggestions: I have a RegisterNewItem Form where a user can add new Items to a shop/database. I have items of type CD (audiocd) with an attribute PlayTime. I store this value as seconds and calculate the minutes to display at runtime. For adding a new CD, I thought that it would be inconvenient to have the user entering either seconds only, or how to agree on a format like Min:Sec OR Min.Sec etc. My idea now is to provide two textFields, one for the minutes and one for the additional seconds. Now I have no idea how to properly use the model of the textfields and the item-object, to calculate the seconds from both fields at submit time. Any help appreciated. Please see the code from the Panel below (currently without a textfield for the playtime). Regards, Stephan public class AddCDPanel extends AddItemPanel { /** * auto-generated UID */ private static final long serialVersionUID = 5390579612171776545L; public AddCDPanel(String id) { super(id, new CD()); TextField labelTextField = new TextField(label, new PropertyModel(itemToInsert,label)); FeedbackLabel labelFeedback = new FeedbackLabel(label.feedback, labelTextField); addItemForm.add(labelTextField.setRequired(true)); addItemForm.add(labelFeedback); TextField artistTextField = new TextField(artist, new PropertyModel(itemToInsert,artist)); FeedbackLabel artistFeedback = new FeedbackLabel(artist.feedback, artistTextField); addItemForm.add(artistTextField.setRequired(true)); addItemForm.add(artistFeedback); } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: (Form) Use two TextFields for one object property?
It depends what your domain object looks like, if it's just a simple string you'll have to save the results of those two textfield's in their own model, and then merge them in the onSubmit method. On Feb 18, 2010, at 1:41 PM, srm wrote: Hi List, the following may looked flawed, so I'm happy to hear your suggestions: I have a RegisterNewItem Form where a user can add new Items to a shop/database. I have items of type CD (audiocd) with an attribute PlayTime. I store this value as seconds and calculate the minutes to display at runtime. For adding a new CD, I thought that it would be inconvenient to have the user entering either seconds only, or how to agree on a format like Min:Sec OR Min.Sec etc. My idea now is to provide two textFields, one for the minutes and one for the additional seconds. Now I have no idea how to properly use the model of the textfields and the item-object, to calculate the seconds from both fields at submit time. Any help appreciated. Please see the code from the Panel below (currently without a textfield for the playtime). Regards, Stephan public class AddCDPanel extends AddItemPanel { /** * auto-generated UID */ private static final long serialVersionUID = 5390579612171776545L; public AddCDPanel(String id) { super(id, new CD()); TextField labelTextField = new TextField(label, new PropertyModel(itemToInsert,label)); FeedbackLabel labelFeedback = new FeedbackLabel(label.feedback, labelTextField); addItemForm.add(labelTextField.setRequired(true)); addItemForm.add(labelFeedback); TextField artistTextField = new TextField(artist, new PropertyModel(itemToInsert,artist)); FeedbackLabel artistFeedback = new FeedbackLabel(artist.feedback, artistTextField); addItemForm.add(artistTextField.setRequired(true)); addItemForm.add(artistFeedback); } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org To our success! Mystic Coders, LLC | Code Magic | www.mysticcoders.com ANDREW LOMBARDI | and...@mysticcoders.com 2321 E 4th St. Ste C-128, Santa Ana CA 92705 ofc: 714-816-4488 fax: 714-782-6024 cell: 714-697-8046 linked-in: http://www.linkedin.com/in/andrewlombardi twitter: http://www.twitter.com/kinabalu Eco-Tip: Printing e-mails is usually a waste. This message is for the named person's use only. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient.
Re: (Form) Use two TextFields for one object property?
Am 18.02.2010 um 22:56 schrieb Andrew Lombardi: It depends what your domain object looks like, if it's just a simple string you'll have to save the results of those two textfield's in their own model, and then merge them in the onSubmit method. It's a int property. I was thinking about using the onSubmit method but how will this interfere with the PropertyModel setting the value according to TextField's value? Does this happen before onSubmit or after onSubmit? If that happens before, I surely can overwrite the DO's property (set via the PropertyModel) in the onSubmit(). Regards, Stephan On Feb 18, 2010, at 1:41 PM, srm wrote: Hi List, the following may looked flawed, so I'm happy to hear your suggestions: I have a RegisterNewItem Form where a user can add new Items to a shop/database. I have items of type CD (audiocd) with an attribute PlayTime. I store this value as seconds and calculate the minutes to display at runtime. For adding a new CD, I thought that it would be inconvenient to have the user entering either seconds only, or how to agree on a format like Min:Sec OR Min.Sec etc. My idea now is to provide two textFields, one for the minutes and one for the additional seconds. Now I have no idea how to properly use the model of the textfields and the item-object, to calculate the seconds from both fields at submit time. Any help appreciated. Please see the code from the Panel below (currently without a textfield for the playtime). Regards, Stephan public class AddCDPanel extends AddItemPanel { /** * auto-generated UID */ private static final long serialVersionUID = 5390579612171776545L; public AddCDPanel(String id) { super(id, new CD()); TextField labelTextField = new TextField(label, new PropertyModel(itemToInsert,label)); FeedbackLabel labelFeedback = new FeedbackLabel(label.feedback, labelTextField); addItemForm.add(labelTextField.setRequired(true)); addItemForm.add(labelFeedback); TextField artistTextField = new TextField(artist, new PropertyModel(itemToInsert,artist)); FeedbackLabel artistFeedback = new FeedbackLabel(artist.feedback, artistTextField); addItemForm.add(artistTextField.setRequired(true)); addItemForm.add(artistFeedback); } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org To our success! Mystic Coders, LLC | Code Magic | www.mysticcoders.com ANDREW LOMBARDI | and...@mysticcoders.com 2321 E 4th St. Ste C-128, Santa Ana CA 92705 ofc: 714-816-4488 fax: 714-782-6024 cell: 714-697-8046 linked-in: http://www.linkedin.com/in/andrewlombardi twitter: http://www.twitter.com/kinabalu Eco-Tip: Printing e-mails is usually a waste. This message is for the named person's use only. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: (Form) Use two TextFields for one object property?
class lengthtextfield extends formcomponentpanel { private final textfield minutes; private final textfield seconds; public lengthtextfield(string id, imodelinteger model) { super(id, model); minutes=new textfield(min,new model(model.getobject()/60),integer.class); seconds=new textfield(min,new model(model.getobject()%60),integer.class); } convertinput() { int mins=minutes.getconvertedinput(); int secs=seconds.getconvertedinput(); setconvertedinput(mins*60+secs); } } wicket:panelinput type=text wicket:id=minutes/:input type=text wicket:id=seconds//wicket:panel -igor On Thu, Feb 18, 2010 at 2:02 PM, srm s...@schokokeks.org wrote: Am 18.02.2010 um 22:56 schrieb Andrew Lombardi: It depends what your domain object looks like, if it's just a simple string you'll have to save the results of those two textfield's in their own model, and then merge them in the onSubmit method. It's a int property. I was thinking about using the onSubmit method but how will this interfere with the PropertyModel setting the value according to TextField's value? Does this happen before onSubmit or after onSubmit? If that happens before, I surely can overwrite the DO's property (set via the PropertyModel) in the onSubmit(). Regards, Stephan On Feb 18, 2010, at 1:41 PM, srm wrote: Hi List, the following may looked flawed, so I'm happy to hear your suggestions: I have a RegisterNewItem Form where a user can add new Items to a shop/database. I have items of type CD (audiocd) with an attribute PlayTime. I store this value as seconds and calculate the minutes to display at runtime. For adding a new CD, I thought that it would be inconvenient to have the user entering either seconds only, or how to agree on a format like Min:Sec OR Min.Sec etc. My idea now is to provide two textFields, one for the minutes and one for the additional seconds. Now I have no idea how to properly use the model of the textfields and the item-object, to calculate the seconds from both fields at submit time. Any help appreciated. Please see the code from the Panel below (currently without a textfield for the playtime). Regards, Stephan public class AddCDPanel extends AddItemPanel { /** * auto-generated UID */ private static final long serialVersionUID = 5390579612171776545L; public AddCDPanel(String id) { super(id, new CD()); TextField labelTextField = new TextField(label, new PropertyModel(itemToInsert,label)); FeedbackLabel labelFeedback = new FeedbackLabel(label.feedback, labelTextField); addItemForm.add(labelTextField.setRequired(true)); addItemForm.add(labelFeedback); TextField artistTextField = new TextField(artist, new PropertyModel(itemToInsert,artist)); FeedbackLabel artistFeedback = new FeedbackLabel(artist.feedback, artistTextField); addItemForm.add(artistTextField.setRequired(true)); addItemForm.add(artistFeedback); } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org To our success! Mystic Coders, LLC | Code Magic | www.mysticcoders.com ANDREW LOMBARDI | and...@mysticcoders.com 2321 E 4th St. Ste C-128, Santa Ana CA 92705 ofc: 714-816-4488 fax: 714-782-6024 cell: 714-697-8046 linked-in: http://www.linkedin.com/in/andrewlombardi twitter: http://www.twitter.com/kinabalu Eco-Tip: Printing e-mails is usually a waste. This message is for the named person's use only. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. - 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: (Form) Use two TextFields for one object property?
Am 18.02.2010 um 23:08 schrieb Igor Vaynberg: snip...snap -igor Thank you, I have to look into this as I have never directly worked with the FormComponentModel. Every day something new :) Regards, Stephan On Thu, Feb 18, 2010 at 2:02 PM, srm s...@schokokeks.org wrote: Am 18.02.2010 um 22:56 schrieb Andrew Lombardi: It depends what your domain object looks like, if it's just a simple string you'll have to save the results of those two textfield's in their own model, and then merge them in the onSubmit method. It's a int property. I was thinking about using the onSubmit method but how will this interfere with the PropertyModel setting the value according to TextField's value? Does this happen before onSubmit or after onSubmit? If that happens before, I surely can overwrite the DO's property (set via the PropertyModel) in the onSubmit(). Regards, Stephan On Feb 18, 2010, at 1:41 PM, srm wrote: Hi List, the following may looked flawed, so I'm happy to hear your suggestions: I have a RegisterNewItem Form where a user can add new Items to a shop/database. I have items of type CD (audiocd) with an attribute PlayTime. I store this value as seconds and calculate the minutes to display at runtime. For adding a new CD, I thought that it would be inconvenient to have the user entering either seconds only, or how to agree on a format like Min:Sec OR Min.Sec etc. My idea now is to provide two textFields, one for the minutes and one for the additional seconds. Now I have no idea how to properly use the model of the textfields and the item-object, to calculate the seconds from both fields at submit time. Any help appreciated. Please see the code from the Panel below (currently without a textfield for the playtime). Regards, Stephan public class AddCDPanel extends AddItemPanel { /** * auto-generated UID */ private static final long serialVersionUID = 5390579612171776545L; public AddCDPanel(String id) { super(id, new CD()); TextField labelTextField = new TextField(label, new PropertyModel(itemToInsert,label)); FeedbackLabel labelFeedback = new FeedbackLabel(label.feedback, labelTextField); addItemForm.add(labelTextField.setRequired(true)); addItemForm.add(labelFeedback); TextField artistTextField = new TextField(artist, new PropertyModel(itemToInsert,artist)); FeedbackLabel artistFeedback = new FeedbackLabel(artist.feedback, artistTextField); addItemForm.add(artistTextField.setRequired(true)); addItemForm.add(artistFeedback); } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org To our success! Mystic Coders, LLC | Code Magic | www.mysticcoders.com ANDREW LOMBARDI | and...@mysticcoders.com 2321 E 4th St. Ste C-128, Santa Ana CA 92705 ofc: 714-816-4488 fax: 714-782-6024 cell: 714-697-8046 linked-in: http://www.linkedin.com/in/andrewlombardi twitter: http://www.twitter.com/kinabalu Eco-Tip: Printing e-mails is usually a waste. This message is for the named person's use only. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: (Form) Use two TextFields for one object property?
class MyForm extends Form { private int hour; private int second; public Form { add(new TextField(hour, new PropertyModel(MyForm.class, hour))); add(new TextField(second, new PropertyModel(MyForm.class, second))); } public void onSubmit() { if(!validTime(hour, second)) error(uhh ... hello?); // do more stuff } On Feb 18, 2010, at 2:02 PM, srm wrote: Am 18.02.2010 um 22:56 schrieb Andrew Lombardi: It depends what your domain object looks like, if it's just a simple string you'll have to save the results of those two textfield's in their own model, and then merge them in the onSubmit method. It's a int property. I was thinking about using the onSubmit method but how will this interfere with the PropertyModel setting the value according to TextField's value? Does this happen before onSubmit or after onSubmit? If that happens before, I surely can overwrite the DO's property (set via the PropertyModel) in the onSubmit(). Regards, Stephan On Feb 18, 2010, at 1:41 PM, srm wrote: Hi List, the following may looked flawed, so I'm happy to hear your suggestions: I have a RegisterNewItem Form where a user can add new Items to a shop/database. I have items of type CD (audiocd) with an attribute PlayTime. I store this value as seconds and calculate the minutes to display at runtime. For adding a new CD, I thought that it would be inconvenient to have the user entering either seconds only, or how to agree on a format like Min:Sec OR Min.Sec etc. My idea now is to provide two textFields, one for the minutes and one for the additional seconds. Now I have no idea how to properly use the model of the textfields and the item-object, to calculate the seconds from both fields at submit time. Any help appreciated. Please see the code from the Panel below (currently without a textfield for the playtime). Regards, Stephan public class AddCDPanel extends AddItemPanel { /** * auto-generated UID */ private static final long serialVersionUID = 5390579612171776545L; public AddCDPanel(String id) { super(id, new CD()); TextField labelTextField = new TextField(label, new PropertyModel(itemToInsert,label)); FeedbackLabel labelFeedback = new FeedbackLabel(label.feedback, labelTextField); addItemForm.add(labelTextField.setRequired(true)); addItemForm.add(labelFeedback); TextField artistTextField = new TextField(artist, new PropertyModel(itemToInsert,artist)); FeedbackLabel artistFeedback = new FeedbackLabel(artist.feedback, artistTextField); addItemForm.add(artistTextField.setRequired(true)); addItemForm.add(artistFeedback); } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org To our success! Mystic Coders, LLC | Code Magic | www.mysticcoders.com ANDREW LOMBARDI | and...@mysticcoders.com 2321 E 4th St. Ste C-128, Santa Ana CA 92705 ofc: 714-816-4488 fax: 714-782-6024 cell: 714-697-8046 linked-in: http://www.linkedin.com/in/andrewlombardi twitter: http://www.twitter.com/kinabalu Eco-Tip: Printing e-mails is usually a waste. This message is for the named person's use only. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org To our success! Mystic Coders, LLC | Code Magic | www.mysticcoders.com ANDREW LOMBARDI | and...@mysticcoders.com 2321 E 4th St. Ste C-128, Santa Ana CA 92705 ofc: 714-816-4488 fax: 714-782-6024 cell: 714-697-8046 linked-in: http://www.linkedin.com/in/andrewlombardi twitter: http://www.twitter.com/kinabalu Eco-Tip: Printing e-mails is usually a waste. This message is for the named person's use only. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient.
[1.4.6] NotSerializableException: java.nio.HeapCharBuffer
Hi I found a lot of NotSerializableException: java.nio.HeapCharBuffer when I try Wicket 1.4.6 + Resin 4.0.3 I've never seen this exception , is it the problem from Wicket ? Stacktrace : java.io.NotSerializableException: java.nio.HeapCharBuffer at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:416) at org.apache.wicket.Component.writeObject(Component.java:4439) at sun.reflect.GeneratedMethodAccessor5608.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at
StringResourceModel and Hashtable...
StringResourceModel.getString() calls MessageFormat.format(). Unfortunately, NumberFormat.getInstance(), which is called indirectly, uses a Hashtable resulting in lots of contention. Not sure why NumberFormat isnt using a ConcurrentMap instead... but any ideas on how to get around this? If there isn't a way around this, is StringResourceModel only used when explicitly init'd by client app, or is wicket using it internally as well? In our app we do use StringResourceModel quite a bit (it's nicely done), but not with numbers... thanks -nikita Stacks at 19:12 http-8080-19 [BLOCKED] CPU time: 0:23 java.util.Hashtable.get(Object) java.text.NumberFormat.getInstance(Locale, int) java.text.NumberFormat.getInstance(Locale) java.text.MessageFormat.subformat(Object[], StringBuffer, FieldPosition, List) java.text.MessageFormat.format(Object, StringBuffer, FieldPosition) java.text.Format.format(Object) org.apache.wicket.model.StringResourceModel.getString() org.apache.wicket.model.StringResourceModel.load() org.apache.wicket.model.StringResourceModel.load() org.apache.wicket.model.LoadableDetachableModel.getObject() org.apache.wicket.model.StringResourceModel$AssignmentWrapper.getObject() org.apache.wicket.model.StringResourceModel$AssignmentWrapper.getObject() org.apache.wicket.Component.getDefaultModelObject() org.apache.wicket.Component.getDefaultModelObjectAsString() org.apache.wicket.markup.html.basic.Label.onComponentTagBody(MarkupStream, ComponentTag) org.apache.wicket.Component.renderComponent(MarkupStream) org.apache.wicket.markup.html.WebComponent.onRender(MarkupStream) org.apache.wicket.Component.render(MarkupStream) org.apache.wicket.MarkupContainer.renderNext(MarkupStream) org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupStream, ComponentTag) org.apache.wicket.MarkupContainer.renderAssociatedMarkup(String, String) org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(MarkupStream, ComponentTag) org.apache.wicket.Component.renderComponent(MarkupStream) org.apache.wicket.MarkupContainer.onRender(MarkupStream) org.apache.wicket.Component.render(MarkupStream) org.apache.wicket.MarkupContainer.renderNext(MarkupStream) org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupStream, ComponentTag) org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupStream, ComponentTag) org.apache.wicket.Component.renderComponent(MarkupStream) org.apache.wicket.MarkupContainer.onRender(MarkupStream) org.apache.wicket.Component.render(MarkupStream) org.apache.wicket.markup.repeater.AbstractRepeater.renderChild(Component) org.apache.wicket.markup.repeater.AbstractRepeater.onRender(MarkupStream) org.apache.wicket.Component.render(MarkupStream) org.apache.wicket.MarkupContainer.renderNext(MarkupStream) org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupStream, ComponentTag) org.apache.wicket.MarkupContainer.renderAssociatedMarkup(String, String) org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(MarkupStream, ComponentTag) org.apache.wicket.Component.renderComponent(MarkupStream) org.apache.wicket.MarkupContainer.onRender(MarkupStream) org.apache.wicket.Component.render(MarkupStream) org.apache.wicket.MarkupContainer.renderNext(MarkupStream) org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupStream, ComponentTag) org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupStream, ComponentTag) org.apache.wicket.Component.renderComponent(MarkupStream) org.apache.wicket.MarkupContainer.onRender(MarkupStream) org.apache.wicket.Component.render(MarkupStream) org.apache.wicket.MarkupContainer.autoAdd(Component, MarkupStream) org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupContainer, MarkupStream, ComponentTag) org.apache.wicket.markup.resolver.ComponentResolvers.resolve(Application, MarkupContainer, MarkupStream, ComponentTag) org.apache.wicket.MarkupContainer.renderNext(MarkupStream) org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupStream, ComponentTag) org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupStream, ComponentTag) org.apache.wicket.Component.renderComponent(MarkupStream) org.apache.wicket.MarkupContainer.onRender(MarkupStream) org.apache.wicket.Component.render(MarkupStream) org.apache.wicket.MarkupContainer.autoAdd(Component, MarkupStream) org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupContainer, MarkupStream, ComponentTag) org.apache.wicket.markup.resolver.ComponentResolvers.resolve(Application, MarkupContainer, MarkupStream, ComponentTag) org.apache.wicket.MarkupContainer.renderNext(MarkupStream) org.apache.wicket.MarkupContainer.renderAll(MarkupStream) org.apache.wicket.Page.onRender(MarkupStream) org.apache.wicket.Component.render(MarkupStream) org.apache.wicket.Page.renderPage() org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(RequestCycle)
Re: Selenium Testing - Ajax Loads
I'm holding off for a bit. I want to make sure my approach is rock solid.. D/ On Feb 17, 2010, at 1:02 AM, Igor Vaynberg wrote: our wiki is here: http://cwiki.apache.org/WICKET register yourself an account and you should be good to go. -igor On Tue, Feb 16, 2010 at 9:43 PM, Douglas Ferguson doug...@douglasferguson.us wrote: Igor, I have a decent solution and could put together a wiki page, just need to know where/how.. here's what I've got. Click and Wait for wicket: protected void clickAndWait(String wicketPath, long timeOut){ String callbackScript = if(!window.outstandingWicketCalls){ + window.outstandingWicketCalls = 0; + var oldWicketGlobalPreCallHandler = window.wicketGlobalPreCallHandler; + var oldWicketGlobalPostCallHandler = window.wicketGlobalPostCallHandler; + window.wicketGlobalPreCallHandler = function() { + window.outstandingWicketCalls++; + oldWicketGlobalPreCallHandler(); + }; + window.wicketGlobalPostCallHandler = function() { + oldWicketGlobalPostCallHandler(); + window.outstandingWicketCalls--; + }; + } + window.write(window.outstandingWicketCalls);; selenium.runScript(callbackScript); click(wicketPath); selenium.waitForCondition(selenium.browserbot.getCurrentWindow();window.outstandingWicketCalls===0, Duration.seconds(8).getMilliseconds() +); } Deal with unstable wicket paths protected String getDOMLocator(String xpathTagName, String wicketPath, int index){ String regex = _(\\d+|#)(_|$); Pattern repeaterWicketPathPatter = Pattern.compile(regex); Matcher matcher = repeaterWicketPathPatter.matcher(wicketPath); while(matcher.find()){ try{ if(index == -1){ index = Integer.parseInt(matcher.group(1)); } String xpathRegex = _[0-9]+; if(_.equals(matcher.group(2))){ xpathRegex = xpathRegex + _; } wicketPath = wicketPath.replace(matcher.group(), xpathRegex); }catch(NumberFormatException nfe){ fail(index is required for getDOMLocator, please pass it to the method or as the first numeric value in the wicketpath provide i.e. foo_bar_134_child_#_child2_#); } } StringWriter domLocator = new StringWriter(); domLocator.append(dom=); if(index 0){ domLocator.append(window.findElementByWicketPath('); domLocator.append(wicketPath); domLocator.append(', ); domLocator.append(String.valueOf(index-1)); domLocator.append();); }else { domLocator.append(window.$('[wicketpath=\\'); domLocator.append(wicketPath); domLocator.append(\\']').get(0);); } return domLocator.toString(); } Douglas Ferguson mobile: 512.293.7279 office/fax: 512.462.0408 skype: stillrecording aim: DaAmericanRuse - http://www.linkedin.com/in/douglasferguson http://www.myspace.com/douglasferguson http://www.douglasferguson.us/ http://www.distilleryrecords.com/ http://www.stillrecording.com/ Join my mailing list: distilleryrecords-subscr...@yahoogroups.com From: Igor Vaynberg [igor.vaynb...@gmail.com] Sent: Tuesday, February 16, 2010 11:11 AM To: users@wicket.apache.org Subject: Re: Selenium Testing - Ajax Loads how would you do that exactly? -igor On Tue, Feb 16, 2010 at 7:26 AM, Douglas Ferguson doug...@douglasferguson.us wrote: the path in repeaters is never stable, it depends on a lot of factors and is hard to predict. i think what may be a good way to deal with it is to use an IComponentInstantiationListener to add a behavior to Item subclasses to output their index in some attribute. install this listener only during test time or simply make it output nothing if not during the test. Interesting I'll look into it.. Is there really any reason why not to just always have the listener there. Seems like
Re: Create Wikcet Filter
Would you like to ask something or are you just fine? 2010/2/18 Matías G. Tito mt...@zauber.com.ar: I'm loking for creatting a basic wicket filter for / - 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
[OT] Wicket changed my life !
I love Wicket ! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [OT] Wicket changed my life !
Me too!! On Fri, Feb 19, 2010 at 9:57 AM, Ashika Umanga Umagiliya auma...@biggjapan.com wrote: I love Wicket ! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [1.4.6] NotSerializableException: java.nio.HeapCharBuffer
This is not the full stack trace. SerializationChecker produces nice formatted output telling you exactly which field of which class is not serializable. On Fri, 2010-02-19 at 11:58 +0800, smallufo wrote: Hi I found a lot of NotSerializableException: java.nio.HeapCharBuffer when I try Wicket 1.4.6 + Resin 4.0.3 I've never seen this exception , is it the problem from Wicket ? Stacktrace : java.io.NotSerializableException: java.nio.HeapCharBuffer at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:416) at org.apache.wicket.Component.writeObject(Component.java:4439) at sun.reflect.GeneratedMethodAccessor5608.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at