Wicket dev oppty in Redwood City, CA
Hi, folks: We're scrappy startup looking for a generalist dev; familiarity with Wicket a definite plus. Here's the req: http://bit.ly/dogOl0 Feel free to reply to me directly if interested. thanks, -nikita
Re: robots.txt
..that assumes that the app's context path is /. On Sun, Aug 8, 2010 at 3:03 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! You can insert static stuff in webapp/. directory. ** Martin 2010/8/8 Sefa Irken sefair...@gmail.com: This is a ridicilous question, I am pretty new to web and servlet world (coming from desktop java). I couldn't figure out, how to serve my robots.txt under www.site.com/robots.txt. How can I do that in Wicket ? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: robots.txt
my bad - let me clarify: if robots.txt is being stored in appserver's webapp directory, then yes, that'll work regardless app's context path. If it's being packaged with the webapp - and is part of, say, a mvn project, it can be stored in {project}/src/main/webapp. However, the webapp should then be deployed @ root context. -nikita On Sun, Aug 8, 2010 at 11:28 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Not really... 2010/8/8 Nikita Tovstoles nikita.tovsto...@gmail.com: ..that assumes that the app's context path is /. On Sun, Aug 8, 2010 at 3:03 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! You can insert static stuff in webapp/. directory. ** Martin 2010/8/8 Sefa Irken sefair...@gmail.com: This is a ridicilous question, I am pretty new to web and servlet world (coming from desktop java). I couldn't figure out, how to serve my robots.txt under www.site.com/robots.txt. How can I do that in Wicket ? - 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: html validator that parses add'l dtd's?
Can anyone recommend a validator (browser plugin, online, or eclipse plugin) that won't complain about wicket tags when dtd is declared properly. W3C complains about those tags even if the following is declared: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket= http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd; xml:lang=en lang=en thanks, -nikita
Re: OT: html validator that parses add'l dtd's?
right, that avoids having to validate wicket tags. However, since the URL to the wicket DTD is provided, it'd be nice to validate the dev mode doc as well (or at least not see false errors while running a validator in dev mode) On Fri, Jun 11, 2010 at 3:07 PM, nicolas melendez nfmelen...@gmail.comwrote: set up your app en deployment mode, or copy the development mode setup of wicket and modify it in order to not show wicket:id tag On Fri, Jun 11, 2010 at 3:36 PM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: Can anyone recommend a validator (browser plugin, online, or eclipse plugin) that won't complain about wicket tags when dtd is declared properly. W3C complains about those tags even if the following is declared: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket= http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd; xml:lang=en lang=en thanks, -nikita -- Nicolás Meléndez Java Software Developer 1) Google App Engine works: 1.a) http://www.clasificad.com.ar (Local free classifieds for housing, sale, services, local community, curses,jobs, and events - GAE/J + Wicket + YUI) 1.b) http://www.chessk.com (Massive multiplayer chess online GAE/J + Applets + Wicket) 2) Linkedin: http://ar.linkedin.com/in/nicolasmelendez
Re: pass request context to jquey in wicket pages
Take a look at: WebRequest.getURL() and RequestUtils.toAbsolutePath() -nikita On Thu, May 20, 2010 at 9:19 AM, fachhoch fachh...@gmail.com wrote: here is my jqery $(document).ready(function(){ $(a.downloadHelp).live('click', function(e){ e.preventDefault(); window.location.href = '/artms/downloads/db-model.pdf'; }); }); artms is my request Context ,I add this script to my pages using response.renderJavascript, is there any way I can pass the request context instead of hardcoding it? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/pass-request-context-to-jquey-in-wicket-pages-tp2224828p2224828.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WicketTester fails with a custom WebRequestCodingStrategy
could you please post the value of Location (302) header? On Sat, Apr 24, 2010 at 8:41 PM, Kent Tong k...@cpttm.org.mo wrote: Hi Martin, You may take a look at http://wicketpagetest.sourceforge.net/ which will work for your case. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicketstuff updated!
Could someone pls point me to 1.4.7-SNAPSHOT maven repo location? It's not here: http://wicketstuff.org/maven/repository/org/wicketstuff/wicketstuff-core/ thanks -nikita On Wed, Mar 24, 2010 at 2:26 PM, nino martinez wael nino.martinez.w...@gmail.com wrote: artifacts should find their way into the repo once team city builds.. 2010/3/24 Boris Goldowsky bgoldow...@cast.org: As discussed, and not hearing any objections, I've updated the wicketstuff-core project to depend on Wicket 1.4.7. wicketstuff-core's version number is now 1.4.7-SNAPSHOT, and the idea is that people can test it, and barring any major problems it can be released as a stable version 1.4.7 . Now, before people can easily test this, the artifacts need to get into the wicket snapshots maven repository, right? Can someone with the requisite permissions make this happen? In the meantime of course people are encouraged to download the projects and build and test them locally. In addition to wicket, the following dependencies were also updated to the latest stable version within the same major version of the project. I did not attempt to move Lucene from version 2.4.1 to 3.0.1, for instance, since more significant changes might be required for this (if any subproject is actually using it). Jetty: 6.1.22 Lucene: 2.4.1 slf4j: 1.5.11 JUnit: 4.8.1 I had to make a couple of changes to get everything to build with the new dependencies (commented out wagon-ssh-external extension from inmethod-grid; added new required constructor argument to two instances of SpringComponentInjector). People should test the build and make sure these changes are ok. But at least for me, I can do a mvn install at the top level and it works. Bng - 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: PackageResource that isn't tied to session; returns 302?
Answering my own question: use Resource Reference: new Image(img, new ResourceReference(Page2.class, image.png)); On Wed, Apr 14, 2010 at 3:23 PM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: Correction: PackageResource packageResource = PackageResource.get(Page2.class, image.png); does correctly set response headers (to allow for 304). But, for some reason, the link generated is not static and is instead tied to an HttpSession. Any way to get a Session-independent packageResource (for static image)? On Tue, Apr 13, 2010 at 6:05 PM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: Given this page: public class Page2 extends WebPage { public Page2() { add(new Image(plainImage, image.png)); PackageResource packageResource = PackageResource.get(Page2.class, image.png); add(new Image(pkgImage, packageResource)); } } plainImage produces an img that returns a 304 on page reload; and is not tied to a session. pkgImage, however, renders as a 'wicket:interface' url that actually re-loads an image (200) on page reload, and is tied to a session (throws PageExpiredException) when session expires or sessionid is removed from img src. Is there way to get a (Package)Resource that is not session-specific? I see a SharedResources but am unsure how to access it. We need to new Image in several places whose source paths are computed at render time from page params, yet are always relative to the same component class (support of multiple LF). I recognize that we could use a ContextImage instead, but I am curious to find an approach that would also work for JS/CSS. thanks -nikita -- --- Nikita Tovstoles CTO, CastaneaLabs.com (m) +1-650-996-8173 (e) ntovsto...@castanealabs.com ---
Re: Newbie Question about populating form values
If you're using a CPM there's no need to explicitly set models for child components. Also think about what you want to happen on page reload. Generally I'd imagine you want current data, so set CPM's object on Page.onBeforeRender(): public class EmployeeMain extends BasePage{ final private FormContact employeeForm; public EmployeeMain() { //super(); //no need - call implied employeeForm = new FormContact(employeeContactForm, new CompoundpropertyModel(null)); //we'll set model object @ page render time add(employeeForm); employeeForm.add(new TextFieldString(firstName)); //assuming existence of String contact.getFirstName() method employeeForm.add(new TextFieldString(lastName)); } @Override public void onBeforeRender() { employeeForm.setDefaultModelObject(getEmployeeSession().getEmployee().getEmpInfo()); //get up-to-date Contact and set as CPM's object super.onBeforeRender(); //have to call to allow page children to render themselves } that's it. Note that if you set CPM's object in page constructor, then on page refresh, Contact won't be updated (because constructor won't run, but onBeforeRender() will). On Wed, Apr 14, 2010 at 8:39 AM, David Hamilton dhamil...@hermitagelighting.com wrote: I'm a new Wicket using trying to figure out how to populate a form's initial value with data from a bean (that is in the session already). I've actually got it working, but I don't think I'm doing the best way. public final class EmployeeMain extends BasePage { public EmployeeMain() { super (); Form employeeForm=new Form(employeeContactForm); Contact contact=getEmployeeSession().getEmployee().getEmpInfo(); employeeForm.setModel(new CompoundPropertyModel(contact)); add(new TextField(firstName,new Model(contact.getFirstName(; add(new TextField(lastName)); } My issue is with this line: add(new TextField(firstName,new Model(contact.getFirstName(; Should I have to set the model even though I'm binding the form to a bean has this property? What is the correct way to handle setting the initial form value from a bean? Thanks, David Keep it Green! To help protect the environment, please only print this email if necessary. Printing email can cost more than you think. Learn more on our website: http://www.hermitagelighting.com/printing_email.php The information transmitted in this email is intended solely for the individual or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this email in error please immediately notify us by reply email to the sender. You must destroy the original material and its contents from any computer. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Newbie Question about populating form values
Yeah, guess you could do that too, but then you'd have to wrap one model into another (since LDM does not do property matching like CPM) + you've to extend LDM. On Wed, Apr 14, 2010 at 9:24 AM, James Carman jcar...@carmanconsulting.comwrote: Why not use a LoadableDetachableModel instead of setting on onBeforeRender()? On Wed, Apr 14, 2010 at 12:10 PM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: If you're using a CPM there's no need to explicitly set models for child components. Also think about what you want to happen on page reload. Generally I'd imagine you want current data, so set CPM's object on Page.onBeforeRender(): public class EmployeeMain extends BasePage{ final private FormContact employeeForm; public EmployeeMain() { //super(); //no need - call implied employeeForm = new FormContact(employeeContactForm, new CompoundpropertyModel(null)); //we'll set model object @ page render time add(employeeForm); employeeForm.add(new TextFieldString(firstName)); //assuming existence of String contact.getFirstName() method employeeForm.add(new TextFieldString(lastName)); } @Override public void onBeforeRender() { employeeForm.setDefaultModelObject(getEmployeeSession().getEmployee().getEmpInfo()); //get up-to-date Contact and set as CPM's object super.onBeforeRender(); //have to call to allow page children to render themselves } that's it. Note that if you set CPM's object in page constructor, then on page refresh, Contact won't be updated (because constructor won't run, but onBeforeRender() will). On Wed, Apr 14, 2010 at 8:39 AM, David Hamilton dhamil...@hermitagelighting.com wrote: I'm a new Wicket using trying to figure out how to populate a form's initial value with data from a bean (that is in the session already). I've actually got it working, but I don't think I'm doing the best way. public final class EmployeeMain extends BasePage { public EmployeeMain() { super (); Form employeeForm=new Form(employeeContactForm); Contact contact=getEmployeeSession().getEmployee().getEmpInfo(); employeeForm.setModel(new CompoundPropertyModel(contact)); add(new TextField(firstName,new Model(contact.getFirstName(; add(new TextField(lastName)); } My issue is with this line: add(new TextField(firstName,new Model(contact.getFirstName(; Should I have to set the model even though I'm binding the form to a bean has this property? What is the correct way to handle setting the initial form value from a bean? Thanks, David Keep it Green! To help protect the environment, please only print this email if necessary. Printing email can cost more than you think. Learn more on our website: http://www.hermitagelighting.com/printing_email.php The information transmitted in this email is intended solely for the individual or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this email in error please immediately notify us by reply email to the sender. You must destroy the original material and its contents from any computer. - 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
PackageResource that isn't tied to session; returns 302?
Given this page: public class Page2 extends WebPage { public Page2() { add(new Image(plainImage, image.png)); PackageResource packageResource = PackageResource.get(Page2.class, image.png); add(new Image(pkgImage, packageResource)); } } plainImage produces an img that returns a 304 on page reload; and is not tied to a session. pkgImage, however, renders as a 'wicket:interface' url that actually re-loads an image (200) on page reload, and is tied to a session (throws PageExpiredException) when session expires or sessionid is removed from img src. Is there way to get a (Package)Resource that is not session-specific? I see a SharedResources but am unsure how to access it. We need to new Image in several places whose source paths are computed at render time from page params, yet are always relative to the same component class (support of multiple LF). I recognize that we could use a ContextImage instead, but I am curious to find an approach that would also work for JS/CSS. thanks -nikita
Re: debugging PageExpiredExceptions
So far I traced this down to the fact that sometimes some wicket:interface requests (in our case used in img src and in anchor 'href) do not include a jsessionid - either as a ;jsessionid= URL param or a cookie - thus no session can be found. The container's impl of HttpServletResponse.encodeURL(String) decides whether to rewrite the URL with jsessionid. It's supposed to NOT rewrite the URL if the client is confirmed to support cookie (though there are other criteria). I imagine that works correctly (we're using Tomcat 6.0.20). Anyone know of cases wherein wicket does not call response.encodeURL(generatedURL) for whatever reason? -nikita On Fri, Apr 9, 2010 at 3:51 PM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: Here's a typical exception: 00:01:17,644 ERROR CLPWebRequestCycle:34 - Cannot find the rendered page in session [pagemap=null,componentPath=7:results:resultsInfo:criteriaContainer:inputPanel:categorySearchForm:submitLink:searchButton,versionNumber=0] org.apache.wicket.protocol.http.PageExpiredException: Cannot find the rendered page in session [pagemap=null,componentPath=7:results:resultsInfo:criteriaContainer:inputPanel:categorySearchForm:submitLink:searchButton,versionNumber=0] at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:197) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312) On Fri, Apr 9, 2010 at 3:35 PM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: We're seeing a PageExpiredExceptions in roughly 2-6% of our production web sessions and cannot determine the root cause: 1. it's not a session affinity problem (we went as far as running a single node - the exceptions persisted) 2. it's not a session expiration case (our avg production session is far less than 40 min session timeout value; given the number of sessions wherein PEEs occur it's highly unlikely that those sessions are the 40+ min outliers 3. it's not a serialization problem - everything on pages is serializable. And if it were a serialization issue, should we not be seeing WicketSerializeableException stack traces in the logs? 4. Settings.automaticMultiWindowSupport remains at default (=true) 5. we cannot come up with a consistent repro though somehow managed to cause PEE to happen a couple of times by seemingly randomly clicking on UI controls and playing with back/forward browser buttons Any tips on how to go about determining the root cause? Looking at the exception below (typical - always thrown from WebRequestCycleProcessor.resolve()), what specifically would you look for? Which loggers would it be useful to turn to debug? Also, is there any way to determine Page class type when catching a PageExpiredException - so at least we could implement on PEE throw new RestartResponseException(pageType, defaultParams) - instead of showing the default error page. thanks, -nikita
Re: wicket redirecting to relative URLs
For folks who use JMeter to load test wicket apps and are having problems with 404s on redirect URLs containing '/..': I posted a patch to JMeter trunk that fixes the problem by simulating behavior of major browsers - collapsing the URL before issuing the successive GET: https://issues.apache.org/bugzilla/show_bug.cgi?id=49083 apply to JMeter trunk On Thu, Apr 8, 2010 at 12:06 PM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: ahh, good point. I was looking at this: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30Are you suggesting it's Tomcat's responsibility to either: - collapse the '/../' when generating the absolute URL for the Location response header OR - deal with those URLs when parsing a request? -nikita On Thu, Apr 8, 2010 at 8:35 AM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: I am working on a patch to JMeter to rewrite absolute URLs containing '/../' before issuing GETs and have an observation and a question. The problem is described here: http://markmail.org/thread/3ci5hayvqyjhi2ud FWIW this was discussed before and there's WICKET-2728 and related JIRAs. My understanding is that the reason wicket chose to break the RFC and issue relative URL redirects is to accommodate a 'real world' case. I can understand that. Unfortunately, Response.encodeRedirectURL in Tomcat will rewrite redirectURL to absolute anyway, thus returning Location as absolute yet containing '/../' that - if replayed as is - will result in a 404. (see toAbsolute() in http://kickjava.com/src/org/apache/catalina/connector/Response.java.htm). So the benefit derived from breaking RFC seems to be obviated, no? So, given that Tomcat is widely used container, what was the logic in trading off RFC compliance? Just trying to understand the philosophy. thanks -nikita
debugging PageExpiredExceptions
We're seeing a PageExpiredExceptions in roughly 2-6% of our production web sessions and cannot determine the root cause: 1. it's not a session affinity problem (we went as far as running a single node - the exceptions persisted) 2. it's not a session expiration case (our avg production session is far less than 40 min session timeout value; given the number of sessions wherein PEEs occur it's highly unlikely that those sessions are the 40+ min outliers 3. it's not a serialization problem - everything on pages is serializable. And if it were a serialization issue, should we not be seeing WicketSerializeableException stack traces in the logs? 4. Settings.automaticMultiWindowSupport remains at default (=true) 5. we cannot come up with a consistent repro though somehow managed to cause PEE to happen a couple of times by seemingly randomly clicking on UI controls and playing with back/forward browser buttons Any tips on how to go about determining the root cause? Looking at the exception below (typical - always thrown from WebRequestCycleProcessor.resolve()), what specifically would you look for? Which loggers would it be useful to turn to debug? Also, is there any way to determine Page class type when catching a PageExpiredException - so at least we could implement on PEE throw new RestartResponseException(pageType, defaultParams) - instead of showing the default error page. thanks, -nikita
Re: debugging PageExpiredExceptions
Here's a typical exception: 00:01:17,644 ERROR CLPWebRequestCycle:34 - Cannot find the rendered page in session [pagemap=null,componentPath=7:results:resultsInfo:criteriaContainer:inputPanel:categorySearchForm:submitLink:searchButton,versionNumber=0] org.apache.wicket.protocol.http.PageExpiredException: Cannot find the rendered page in session [pagemap=null,componentPath=7:results:resultsInfo:criteriaContainer:inputPanel:categorySearchForm:submitLink:searchButton,versionNumber=0] at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:197) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312) On Fri, Apr 9, 2010 at 3:35 PM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: We're seeing a PageExpiredExceptions in roughly 2-6% of our production web sessions and cannot determine the root cause: 1. it's not a session affinity problem (we went as far as running a single node - the exceptions persisted) 2. it's not a session expiration case (our avg production session is far less than 40 min session timeout value; given the number of sessions wherein PEEs occur it's highly unlikely that those sessions are the 40+ min outliers 3. it's not a serialization problem - everything on pages is serializable. And if it were a serialization issue, should we not be seeing WicketSerializeableException stack traces in the logs? 4. Settings.automaticMultiWindowSupport remains at default (=true) 5. we cannot come up with a consistent repro though somehow managed to cause PEE to happen a couple of times by seemingly randomly clicking on UI controls and playing with back/forward browser buttons Any tips on how to go about determining the root cause? Looking at the exception below (typical - always thrown from WebRequestCycleProcessor.resolve()), what specifically would you look for? Which loggers would it be useful to turn to debug? Also, is there any way to determine Page class type when catching a PageExpiredException - so at least we could implement on PEE throw new RestartResponseException(pageType, defaultParams) - instead of showing the default error page. thanks, -nikita
wicket redirecting to relative URLs
I am working on a patch to JMeter to rewrite absolute URLs containing '/../' before issuing GETs and have an observation and a question. The problem is described here: http://markmail.org/thread/3ci5hayvqyjhi2ud FWIW this was discussed before and there's WICKET-2728 and related JIRAs. My understanding is that the reason wicket chose to break the RFC and issue relative URL redirects is to accommodate a 'real world' case. I can understand that. Unfortunately, Response.encodeRedirectURL in Tomcat will rewrite redirectURL to absolute anyway, thus returning Location as absolute yet containing '/../' that - if replayed as is - will result in a 404. (see toAbsolute() in http://kickjava.com/src/org/apache/catalina/connector/Response.java.htm). So the benefit derived from breaking RFC seems to be obviated, no? So, given that Tomcat is widely used container, what was the logic in trading off RFC compliance? Just trying to understand the philosophy. thanks -nikita
Re: wicket redirecting to relative URLs
ahh, good point. I was looking at this: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30Are you suggesting it's Tomcat's responsibility to either: - collapse the '/../' when generating the absolute URL for the Location response header OR - deal with those URLs when parsing a request? -nikita On Thu, Apr 8, 2010 at 8:35 AM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: I am working on a patch to JMeter to rewrite absolute URLs containing '/../' before issuing GETs and have an observation and a question. The problem is described here: http://markmail.org/thread/3ci5hayvqyjhi2ud FWIW this was discussed before and there's WICKET-2728 and related JIRAs. My understanding is that the reason wicket chose to break the RFC and issue relative URL redirects is to accommodate a 'real world' case. I can understand that. Unfortunately, Response.encodeRedirectURL in Tomcat will rewrite redirectURL to absolute anyway, thus returning Location as absolute yet containing '/../' that - if replayed as is - will result in a 404. (see toAbsolute() in http://kickjava.com/src/org/apache/catalina/connector/Response.java.htm). So the benefit derived from breaking RFC seems to be obviated, no? So, given that Tomcat is widely used container, what was the logic in trading off RFC compliance? Just trying to understand the philosophy. thanks -nikita
CookieValuePersister and addOrReplace
Hi, We have a TextField whose object value we'd like to populate from a Cookie using CookieValuePersister. Things work fine (persister.save and .load) when the input is added to the form at Form's construction time. However, in cases when the input's added to the form using addOrReplace during form's onBeforeRender, the cookie value is not applied to the input. That appears to be the case because in Page.renderPage() setFormComponentValuesFromCookies() is called *before *prepareForRender() (which ultimately calls onBeforeRender()). So, is the bottom line that CookieValuePersister currently cannot be used when input's added via addOrReplace? If so, seems like it'd be easy to add if there was a componentAdded callback on Form: if(componentAdded.isPersistent()) { this.getPersister().load(componentAdded); }
Re: what's an 'ajax-only' page (wrt HybridUrlCodingStrategy)?
Appreciate your reply. If the redirect to .version is *always* supposed to happen what would be some reason for that failing to happen? For example (i am reaching here) if there are problems serializing the page, is the behavior to fall back to plain bookmarkable url (and not redirect)? Here's an example of a page mounted with HybridUrlCodingStrategy: http://rebatefinder.ecorebates.com/embedded/search/category?siteId=ca So, I'd expect it to redirect to: http://rebatefinder.ecorebates.com/embedded/search/category.0?siteId=ca but no go. this fixes the general problem with ajax requests not changing the url, so if user presses refresh button in the browser the ajax changes are lost. suppose you land on /user/profile/15 url which is bookmarkable and you have a bunch of ajax panel swaps for differnet parts of the user's profile. if the user presses refresh, eg if ajax request is taking too long, the url that is refreshed is the original bookmarkable url and all the changes are lost. however, with the hybrid strategy the user will immediately be redirected to a .x suffix which gives them a stateful url that will keep the changes. at least that was the idea behind the hybrid coding strategy, the hybrid part being that it is both bookmarkable and stateful. -igor On Mon, Mar 22, 2010 at 7:39 PM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: The javadoc for HybridUrlCodingStrategy says: Also to preserve state on refresh with ajax-only pages the HybridUrlCodingStrategy does an immediate redirect after hitting bookmarkable URL, e.g. it immediately redirects from /mount/path to /mount/path.3 where 3 is the next page id. This preserves the page instance on subsequent page refresh. We have a few pages mounted with this strategy - some do issue a redirect to /mountpath.version on 1st request, others for some reason do not. I am assuming that's because some are ajax-only while others are not? if so, what a definition of an ajax-only page? Or - if that's easier - in which cases would this strategy NOT issue a redirect to .version URL? thanks -nikita - 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
what's an 'ajax-only' page (wrt HybridUrlCodingStrategy)?
The javadoc for HybridUrlCodingStrategy says: Also to preserve state on refresh with ajax-only pages the HybridUrlCodingStrategy does an immediate redirect after hitting bookmarkable URL, e.g. it immediately redirects from /mount/path to /mount/path.3 where 3 is the next page id. This preserves the page instance on subsequent page refresh. We have a few pages mounted with this strategy - some do issue a redirect to /mountpath.version on 1st request, others for some reason do not. I am assuming that's because some are ajax-only while others are not? if so, what a definition of an ajax-only page? Or - if that's easier - in which cases would this strategy NOT issue a redirect to .version URL? thanks -nikita - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: can intermittent 'illegal relative path' be cause by something besides broken session affinity?
I wonder if this is a serialization problem: the following request: 10.242.46.21 - - [20/Mar/2010:13:04:19 -0400] POST /?wicket:interface=:0:EmbeddedCategoryCriteriaPanel:inputPanel:categorySearchForm:zipCodeComponent:zipCode::IBehaviorListener:1:10random=0.014624584217842351 HTTP/1.1 200 161 results in this exception: Caused by: org.apache.wicket.WicketRuntimeException: component EmbeddedCategoryCriteriaPanel:inputPanel:categorySearchForm:zipCodeComponent:zipCode not found on page com.castanealabs.gui.interactivemap.*StateProgramDetailsPage*[id = 0], listener interface = [RequestListenerInterface name=IBehaviorListener, method=public abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()] at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426) The problem is, *StateProgramDetailsPage indeed does not contain a EmbeddedCategoryCriteriaPanel in its' hierarchy. So why did wicket decide that it does? The is another page class that does contain a EmbeddedCategoryCriteriaPanel. That class shares a concrete superclass with StateProgramDetailsPage class. That superclass defines a serialVersionUID. * * * *It appears that DiskPageStore is loading instance of the wrong page class. Not sure why... could the fact that the classes share a common superclass with a serialVersionUID be the reason? Doubt it but have no other ideas at the moment.* * * * * Aside: Is there such a thing as an in-memory IPageStore impl (as a band-aid at least...) On Sat, Mar 20, 2010 at 10:11 AM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: We're suddenly seeing a fair number of exceptions like one below. Thought the root cause is failing session affinity in our clusters, but the exceptions persist even after we shut down all but one host behind HAProxy. I realize the question is somewhat ambiguous, but what - besides lack of session affinity - can be some other causes of these exceptions? thanks -nikita 12:56:37,612 ERROR RequestCycle:1521 - submitted http post value [check3] for CheckGroup component [0:EmbeddedCategoryCriteriaPanel:inputPanel:categorySearchForm:brandsComponent:brands] contains an illegal relative path element [check3] which does not point to a Check component. Due to this the CheckGroup component cannot resolve the selected Check component pointed to by the illegal value. A possible reason is that componment hierarchy changed between rendering and form submission. org.apache.wicket.WicketRuntimeException: submitted http post value [check3] for CheckGroup component [0:EmbeddedCategoryCriteriaPanel:inputPanel:categorySearchForm:brandsComponent:brands] contains an illegal relative path element [check3] which does not point to a Check component. Due to this the CheckGroup component cannot resolve the selected Check component pointed to by the illegal value. A possible reason is that componment hierarchy changed between rendering and form submission. at org.apache.wicket.markup.html.form.CheckGroup.convertValue(CheckGroup.java:136) at org.apache.wicket.markup.html.form.CheckGroup.convertValue(CheckGroup.java:58) at org.apache.wicket.markup.html.form.FormComponent.convertInput(FormComponent.java:1301) at org.apache.wicket.markup.html.form.FormComponent.validate(FormComponent.java:1192) at org.apache.wicket.markup.html.form.Form$22.validate(Form.java:2132) at org.apache.wicket.markup.html.form.Form$ValidationVisitor.formComponent(Form.java:171) at org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper(FormComponent.java:441)
Re: can intermittent 'illegal relative path' be cause by something besides broken session affinity?
OK, here's what I can surmise thus far: - Only 'wicket:interface' JS requests - from 'onchange' Ajax validator or from a SubmitLink-initiated form submission trigger the exception - the form being submitted or validated is in a couple of pages but *never *in *StateProgramDetailsPage* - the exceptions thrown only cites *StateProgramDetailsPage* - pages are mounted using HybridURLCodingStrategy and have a common (concrete) super class - in all wicket:interface requests resulting in the exception: pageId = 0; 'version' is always empty (thus wicket defaults to 0) So, in summary, *sometimes* form component Ajax validation or non-Ajax form submission wicket:interface POST requests results in retrieval of the incorrect page - StateProgramDetailsPage - from PageMap. Consequently, the exceptions are thrown. I would appreciate any general thoughts, but also answers to these questions (to help us understand what goes on under the hood): - What logs should we enable to see why an ajax wicket:interface from one page resolves to another page? - Does Wicket Ever manually write out JSESSIONID? In 'wicket:interface' requests specifically? or is that left up to the servlet container? - What is PageMap's scope - one per HttpSession? - What's 'urlDepth'? - What's the lifecycle of a IRequestCycleProcessor and IRequestCodingStrategy? Is newXXX called only once per app? - If we wanted to rule out DiskPageStore by installing an in-memory page store instead how can we do so? Implement own IPageStore? * * *Request 1* * 10.242.46.21 - - [20/Mar/2010:17:41:09 -0400] POST /?wicket:interface=:0:EmbeddedCategoryCriteriaPanel:inputPanel:categorySearchForm:submitLink::IActivePageBehaviorListener:0:10wicket:ignoreIfNotActive=truerandom=0.04114457813227995 HTTP/1.1 200 161 http://rebatefinder.ecorebates.com/embedded/form/category/style/vertical/siteId/sears/adCell/W4/layout/vertical.0;jsessionid=9F0B9124A90DB552A38D2F8E6476F814; Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; GTB6.4; .NET CLR 1.1.4322) Exception 1 Caused by: org.apache.wicket.WicketRuntimeException: component EmbeddedCategoryCriteriaPanel:inputPanel:categorySearchForm:submitLink not found on page com.castanealabs.gui.interactivemap.StateProgramDetailsPage[id = 0], listener interface = [RequestListenerInterface name=IActivePageBehaviorListener, method=public abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()] at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471) Request 2 10.242.46.21 - - [20/Mar/2010:17:39:07 -0400] POST /?wicket:interface=:0:EmbeddedCategoryCriteriaPanel:inputPanel:categorySearchForm:zipCodeComponent:zipCode::IBehaviorListener:1:10random=0.46530282930252486 HTTP/1.1 200 161 http://rebatefinder.ecorebates.com/embedded/form/category/style/vertical/siteId/sears/adCell/W4/layout/vertical.0;jsessionid=C767AD19F2AD165C8F4F7F00C337D385; Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; msn OptimizedIE8;ENUS) Exception 2 * Caused by: org.apache.wicket.WicketRuntimeException: component EmbeddedCategoryCriteriaPanel:inputPanel:categorySearchForm:zipCodeComponent:zipCode not found on page com.castanealabs.gui.interactivemap.StateProgramDetailsPage[id = 0], listener interface = [RequestListenerInterface name=IBehaviorListener, method=public abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()] at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471) at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144) ... 21 more On Sat, Mar 20, 2010 at 1:30 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: i doubt its the diskstore since you are the only one seeing this problem. is this happening on multiple pages or just a particular one? -igor On Sat, Mar 20, 2010 at 10:34 AM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: I wonder if this is a serialization problem: the following request: 10.242.46.21 - - [20/Mar/2010:13:04:19 -0400] POST /?wicket:interface=:0:EmbeddedCategoryCriteriaPanel:inputPanel:categorySearchForm:zipCodeComponent:zipCode::IBehaviorListener:1:10random=0.014624584217842351 HTTP/1.1 200 161 results in this exception: Caused by: org.apache.wicket.WicketRuntimeException: component EmbeddedCategoryCriteriaPanel:inputPanel:categorySearchForm:zipCodeComponent:zipCode not found on page com.castanealabs.gui.interactivemap
Re: can intermittent 'illegal relative path' be cause by something besides broken session affinity?
I may have found something - but first another question: under which conditions would an ajax wicket:interface request omit a 'version'? (I see request processor then assumes that the version is 0). I may have found a race condition: - check out thishttp://www.sears.com/shc/s/nb_10153_12605_NB_EnergyStar+Program+Information?adCell=W4page - observe that it has 2 iframes: a map on the left and a rebate search form on the right. both are served up from our servers (likely the same box) - tabbing out of the zipCode field issues a validation Ajax request; the submit button is actually a SubmitLink (i.e. also uses JS wicket:interface). - The StateProgramDetailsPage page mentioned in the exceptions is what you see when you click on a particular US state on the map - say NY - It's possible that the form on the right is the source of wicket:interface requests causing the exceptions When a version-less wicket:interface request arrives (say, on tab-out from zip code field) eventually SecondLevelCacheSessionStore.get(id, version) gets called wherein we can fall through to a if-branch that picks *the last page rendered*. I realize that id is generated atomically, so in theory the following code should be safe, but it is curious that getLastPage() is called 3 times (instead of being called once to init a local variable). So I'd imagine it's possible that the map of the left sometimes gets rendered later (say *after if (getLastPage() != null getLastPage().getNumericId() == id) is evaluated) and thus subsequent pages.put(id, page); then stores the 'map' page with the 'form' page's id. No?* String sessionId = getSession().getId(); if (sessionId != null) { if (getLastPage() != null getLastPage().getNumericId() == id) { page = versionNumber != -1 ? getLastPage().getVersion(versionNumber) : getLastPage(); if (page != null) { // ask the page store if it is ready saving the page. getStore().pageAccessed(sessionId, page); pages.put(id, page); return page; } } setLastPage(null); page = getStore().getPage(sessionId, getName(), id, versionNumber, -1); pages.put(id, page); return page; } On Sat, Mar 20, 2010 at 3:53 PM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: OK, here's what I can surmise thus far: - Only 'wicket:interface' JS requests - from 'onchange' Ajax validator or from a SubmitLink-initiated form submission trigger the exception - the form being submitted or validated is in a couple of pages but *never *in *StateProgramDetailsPage* - the exceptions thrown only cites *StateProgramDetailsPage* - pages are mounted using HybridURLCodingStrategy and have a common (concrete) super class - in all wicket:interface requests resulting in the exception: pageId = 0; 'version' is always empty (thus wicket defaults to 0) So, in summary, *sometimes* form component Ajax validation or non-Ajax form submission wicket:interface POST requests results in retrieval of the incorrect page - StateProgramDetailsPage - from PageMap. Consequently, the exceptions are thrown. I would appreciate any general thoughts, but also answers to these questions (to help us understand what goes on under the hood): - What logs should we enable to see why an ajax wicket:interface from one page resolves to another page? - Does Wicket Ever manually write out JSESSIONID? In 'wicket:interface' requests specifically? or is that left up to the servlet container? - What is PageMap's scope - one per HttpSession? - What's 'urlDepth'? - What's the lifecycle of a IRequestCycleProcessor and IRequestCodingStrategy? Is newXXX called only once per app? - If we wanted to rule out DiskPageStore by installing an in-memory page store instead how can we do so? Implement own IPageStore? * * *Request 1* * 10.242.46.21 - - [20/Mar/2010:17:41:09 -0400] POST /?wicket:interface=:0:EmbeddedCategoryCriteriaPanel:inputPanel:categorySearchForm:submitLink::IActivePageBehaviorListener:0:10wicket:ignoreIfNotActive=truerandom=0.04114457813227995 HTTP/1.1 200 161 http://rebatefinder.ecorebates.com/embedded/form/category/style/vertical/siteId/sears/adCell/W4/layout/vertical.0;jsessionid=9F0B9124A90DB552A38D2F8E6476F814; Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; GTB6.4; .NET CLR 1.1.4322) Exception 1 Caused by: org.apache.wicket.WicketRuntimeException: component EmbeddedCategoryCriteriaPanel:inputPanel:categorySearchForm:submitLink not found on page com.castanealabs.gui.interactivemap.StateProgramDetailsPage[id = 0], listener interface = [RequestListenerInterface name=IActivePageBehaviorListener, method=public abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()] at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage
TextField w/ bean as model object?
I'd appreciate another pair of eyes on the following: I have a US ZIP Code input text field that I'd like to bind to an Area bean. The idea is that the component would prompt/display for a 5-digit zip code but getModelObject() would return an Area: class ZipInput extends RequiredTextFieldArea; where Area is: class Area{ int zipcode; UsState state; //enum String city; } there is also a AreaService service: //returns true only if zipCode is a valid US zip code boolean isValidZipCode(int zipcode); //return Area bean for given zipCode; throws exception if 'zipCode' isn't a valid US Zip Code Area getArea(int zipCode); The component needs to: - validate that input is present (RequiredValidator?) - convert input from String integer - at some pt call AreaService.isValidZipCode (again, a validation task) - call AreaService.getArea (a conversion task) My main problem is that it seems like AreaService.getArea() should be wrapped into a IConverter, but it, in turn, requires a validation step. However, conversion runs before validation (ie. first I need to convert string-int). So, I guess, I am unsure which of the above should be wrapped into a Converter and which into a Validator (trying to maintain some separation of responsibilities). Should I create a converter that chains StringInt and IntArea conversions? Which would execute AreaService.getArea(zipCode)? thanks -nikita
Re: setResponsePage() in AjaxSubmitLink.onSubmit() redirects to relative URL
just tested with 1.4.7 - can confirm that the issue's been resolved. thanks for a prompt response and congrats on the release On Thu, Mar 4, 2010 at 3:51 AM, Riyad Kalla rka...@gmail.com wrote: I take that back, the vote passed, looks like 24hrs per Igor's comment on wicket-dev? === the vote has passed with 3 +1 binding votes and 5 +1 nonbinding votes i will upload the artifacts to mirrors and write up an announcement after the mirrors have synced (24 hours). cheers === On Thu, Mar 4, 2010 at 4:46 AM, Riyad Kalla rka...@gmail.com wrote: Nikita, The wicket team started the vote on if 1.4.7 was ready to go out a few days ago, it should be either late this week or early next when the release goes out if that helps at all (don't know how immediate your need is). -R On Wed, Mar 3, 2010 at 4:16 PM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: Looks like this bug was identified, and resolved but the fix hasn't been released yet: https://issues.apache.org/jira/browse/WICKET-2717 So, yeah, any tips on an alternative way of combining Ajax validation + plain form submits? thanks -nikita - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- --- Nikita Tovstoles CTO, CastaneaLabs.com (m) +1-650-996-8173 (e) ntovsto...@castanealabs.com ---
lazily loading sublist on vertical scroll?
Hi, We have a listView that may contain 100s of rows. Instead of introducing a pager, we'd like to: - initially load some subset of size N rows - load (and display) additional rows in N increments as user scrolls down - bonus pts: for dropping least recently loaded rows Several sites do this with JS (or even JQuery, I believe). I am guessing this could be done with a Behavior and a PageableListView but would appreciate some pointers or an example. the link below mentions an article on wicketinaction.com, but I couldn't find it: http://mail-archives.apache.org/mod_mbox/wicket-users/200902.mbox/499c6f80.2030...@gmail.comhttp://mail-archives.apache.org/mod_mbox/wicket-users/200902.mbox/%3c499c6f80.2030...@gmail.com%3e thanks a lot, -nikita
setResponsePage() in AjaxSubmitLink.onSubmit() redirects to relative URL
Hello, I have a page with a form and an AjaxSubmitLink. onSubmit(), I need to either render an ajax response or a plain redirect to the same page, depending on a certain condition. I cannot get the latter case (redirect to same page) to work correctly: The Page is mounted like so: mount(new HybridUrlCodingStrategy(/pages/mypage, MyPage.class)); protected void onSubmit(AjaxRequestTarget target, Form? form) { if(condition) { target.addComponent(c); } else { setResponsePage(getPage().getClass()); setRedirect(true); } } The problem is in the 'else' case I get redirected to: 'pages/mypage' - without the leading slash; so the location bar URL ends up: http://localhost:8080/pages/mypage/pages/mypage (and I get a 404). I think this is happening because of the following in WebRequestCodingStrategy.encode(): boolean isAjax = ((WebRequestCycle)requestCycle).getWebRequest().isAjax(); if (url != null !portletRequest) { // We've found the URL and it's mounted. // In the case of Ajax, we don't want to prepend a relative path // to the mounted URL. See WICKET-2312. skipRelativePathPrefix = isAjax; } seems like in this case skipRelativePathPrefix should remain false because BookmarkablePageRequestTarget is being used. If the above is indeed a bug, how else can I combine Ajax validation + plain form submits? thanks, -nikita
Re: setResponsePage() in AjaxSubmitLink.onSubmit() redirects to relative URL
Looks like this bug was identified, and resolved but the fix hasn't been released yet: https://issues.apache.org/jira/browse/WICKET-2717 So, yeah, any tips on an alternative way of combining Ajax validation + plain form submits? thanks -nikita
StringResourceModel and Hashtable...
$HybridBookmarkablePageRequestTarget.respond(RequestCycle) org.apache.wicket.request.AbstractRequestCycleProcessor.respond(RequestCycle) org.apache.wicket.RequestCycle.processEventsAndRespond() org.apache.wicket.RequestCycle.step() org.apache.wicket.RequestCycle.steps() org.apache.wicket.RequestCycle.request() org.apache.wicket.protocol.http.WicketFilter.doGet(HttpServletRequest, HttpServletResponse) org.apache.wicket.protocol.http.WicketFilter.doFilter(ServletRequest, ServletResponse, FilterChain) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) org.apache.catalina.core.ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) org.apache.catalina.core.StandardWrapperValve.invoke(Request, Response) org.apache.catalina.core.StandardContextValve.invoke(Request, Response) org.apache.catalina.core.StandardHostValve.invoke(Request, Response) org.apache.catalina.valves.ErrorReportValve.invoke(Request, Response) org.apache.catalina.valves.AccessLogValve.invoke(Request, Response) org.apache.catalina.core.StandardEngineValve.invoke(Request, Response) org.apache.catalina.connector.CoyoteAdapter.service(Request, Response) org.apache.coyote.http11.Http11Processor.process(Socket) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Socket) org.apache.tomcat.util.net.JIoEndpoint$Worker.run() java.lang.Thread.run() -- --- Nikita Tovstoles cell: +1-650-996-8173 ---
Re: @SpringBean injection expensive - a bug?
Thanks for the fix, zbigniew. However, IMO it isn't complete: https://issues.apache.org/jira/browse/WICKET-2737?focusedCommentId=12834859page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_12834859 what do you think? On Wed, Feb 17, 2010 at 1:20 AM, zbigniew zbys...@consol.pl wrote: Any updates on this issue? Will there be a fix? Check this out: https://issues.apache.org/jira/browse/WICKET-2737 1.4.7 will have that fix, in the meantime you can patch your wicket-spring by yourself. -- View this message in context: http://old.nabble.com/%40SpringBean-injection-expensive---a-bug--tp27520784p27620954.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- --- Nikita Tovstoles cell: +1-650-996-8173 ---
results of WebApplication.getConfigurationType() should be cached to avoid synchronization
, 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) org.apache.wicket.request.target.coding.HybridUrlCodingStrategy$HybridBookmarkablePageRequestTarget.respond(RequestCycle) org.apache.wicket.request.AbstractRequestCycleProcessor.respond(RequestCycle) org.apache.wicket.RequestCycle.processEventsAndRespond() org.apache.wicket.RequestCycle.step() org.apache.wicket.RequestCycle.steps() org.apache.wicket.RequestCycle.request() org.apache.wicket.protocol.http.WicketFilter.doGet(HttpServletRequest, HttpServletResponse) org.apache.wicket.protocol.http.WicketFilter.doFilter(ServletRequest, ServletResponse, FilterChain) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) org.apache.catalina.core.ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) org.apache.catalina.core.StandardWrapperValve.invoke(Request, Response) org.apache.catalina.core.StandardContextValve.invoke(Request, Response) org.apache.catalina.core.StandardHostValve.invoke(Request, Response) org.apache.catalina.valves.ErrorReportValve.invoke(Request, Response) org.apache.catalina.valves.AccessLogValve.invoke(Request, Response) org.apache.catalina.core.StandardEngineValve.invoke(Request, Response) org.apache.catalina.connector.CoyoteAdapter.service(Request, Response) org.apache.coyote.http11.Http11Processor.process(Socket) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Socket) org.apache.tomcat.util.net.JIoEndpoint$Worker.run() java.lang.Thread.run() -- --- Nikita Tovstoles cell: +1-650-996-8173 ---
Re: @SpringBean injection expensive - a bug?
FWIW, explicitly specifying a name with @SpringBean worked around the problem On Tue, Feb 9, 2010 at 11:34 AM, Nikita Tovstoles nikita.tovsto...@gmail.com wrote: Wicket's SpringWebApplication is deprecated and the javadoc advocates using @SpringBean to inject dependencies at component level. However, that appears to be an expensive proposition: I have a listView component that renders a (new) ExternalLink subclass per item. That subclass uses a service (a singleton spring bean) injected via @SpringBean like so: @SpringBean private MyService service; YourKit tells me that when the page is being rendered, 47%(!) of cpu time is being spent constructing the subclass, specifically, repeatedly calling: org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class) The above is getting called with vigor from SpringBeanLocator.hashCode() -- getBeanName() -- getBeanNameOfClass(). HashCode() is likely getting called most often by AnnotProxyFieldValueFactory.cache during look-ups - which I am guessing isn't intentional. Looks like a bug, no? If the above is a bug indeed, is the workaround to always specify a 'name' with @SpringBean? Thoughts? -nikita +-++-+ | Name | Time (ms)| Own Time (ms) | +-++-+ | +---com.castanealabs.gui.component.search.CategoryDataViewPanel$1.populateItem(Item) | 5,430 100 % | 50 | || || | | +---com.castanealabs.gui.component.search.ProductImageCell.init(String, SiteId, IModel) | 2,680 49 % | 20 | || | || | || +---com.castanealabs.gui.embedded.ExternalSiteProductInfoLink.init(String, SiteId, IModel) | 2,660 49 % | 0 | || | || | || +---com.castanealabs.gui.embedded.ExternalSiteProductInfoLink.init(String, SiteId, IModel, IModel) | 2,660 49 % | 0 | || | || | || +---com.castanealabs.gui.embedded.TargetedExternalLink.init(String, IModel, IModel, String) | 2,570 47 % | 0 | || | | || | || | +---org.apache.wicket.markup.html.link.ExternalLink.init(String, IModel, IModel) | 2,570 47 % | 0 | || | | || | || | +---org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class) | 2,570 47 % | 0 | || | | || | || | +---org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(Class) | 2,570 47 % | 0 | || | | || | || | +---org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(Class) | 2,570 47 % | 10 | || | | || | || | +---org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(Class, boolean, boolean)| 2,560 47 % | 0 | || | | || | || | +---org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(String, RootBeanDefinition)| 2,460 45 % | 10 | || | | | || | || | | +---org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(String, RootBeanDefinition, Class[])| 2,420 45 % | 100
@SpringBean injection expensive - a bug?
Wicket's SpringWebApplication is deprecated and the javadoc advocates using @SpringBean to inject dependencies at component level. However, that appears to be an expensive proposition: I have a listView component that renders a (new) ExternalLink subclass per item. That subclass uses a service (a singleton spring bean) injected via @SpringBean like so: @SpringBean private MyService service; YourKit tells me that when the page is being rendered, 47%(!) of cpu time is being spent constructing the subclass, specifically, repeatedly calling: org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class) The above is getting called with vigor from SpringBeanLocator.hashCode() -- getBeanName() -- getBeanNameOfClass(). HashCode() is likely getting called most often by AnnotProxyFieldValueFactory.cache during look-ups - which I am guessing isn't intentional. Looks like a bug, no? If the above is a bug indeed, is the workaround to always specify a 'name' with @SpringBean? Thoughts? -nikita +-++-+ | Name | Time (ms) | Own Time (ms) | +-++-+ | +---com.castanealabs.gui.component.search.CategoryDataViewPanel$1.populateItem(Item) | 5,430 100 % | 50 | | | | | | | +---com.castanealabs.gui.component.search.ProductImageCell.init(String, SiteId, IModel) | 2,680 49 % | 20 | | | | | | | | | +---com.castanealabs.gui.embedded.ExternalSiteProductInfoLink.init(String, SiteId, IModel) | 2,660 49 % | 0 | | | | | | | | | +---com.castanealabs.gui.embedded.ExternalSiteProductInfoLink.init(String, SiteId, IModel, IModel) | 2,660 49 % | 0 | | | | | | | | | +---com.castanealabs.gui.embedded.TargetedExternalLink.init(String, IModel, IModel, String) | 2,570 47 % | 0 | | | | | | | | | | | +---org.apache.wicket.markup.html.link.ExternalLink.init(String, IModel, IModel) | 2,570 47 % | 0 | | | | | | | | | | | +---org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class) | 2,570 47 % | 0 | | | | | | | | | | | +---org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(Class) | 2,570 47 % | 0 | | | | | | | | | | | +---org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(Class) | 2,570 47 % | 10 | | | | | | | | | | | +---org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(Class, boolean, boolean) | 2,560 47 % | 0 | | | | | | | | | | | +---org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(String, RootBeanDefinition) | 2,460 45 % | 10 | | | | | | | | | | | | | +---org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(String, RootBeanDefinition, Class[]) | 2,420 45 % | 100 | | | | | | | | | | | | | | | +---org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(String, RootBeanDefinition, Class[]) | 1,750 32 % | 0 | | | | | | | | | | | | | | | | |