Re: [struts][2.0.11] optiontransferselect limit?
Martin Gainty wrote: good call dale! http://freemarker.org/docs/ref_builtins_expert.html implementing has_content will definitely detect no content condition Rather than detecting no content, what we really want to do is insure that there is valid content. (The previous patch detected this condition and prevented a new assignment from being made, which meant the value from the previous iteration was erroneously re-used--had the first value been null I think it would have crashed.) My current patch (I'll upload today as soon as I clear this backlog of email!) does the assignment non-conditionally, but adds !"" to the end of the RHS, providing a default empty string in case the lookup failed/returned null. -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts][2.0.11] optiontransferselect limit?
Done; thanks :) Yeah, 1124 would be a suspicious magic number ;) There are probably other cases where this (or a similar) patch can be applied; I've been spotting several little holes in some of the tag libs but am pretty swamped at the moment. It'll all get done. d. --- Dale Newfield <[EMAIL PROTECTED]> wrote: > Dale Newfield wrote: > > Martin Gainty wrote: > >> this is the applicable code in my copy of optiontransferselect.ftl > > Thanks for making me look at this--it led me straight to my problem! > > > So we know there is a problem with the freemarker libraries, and that > > it's either in ?exists, or stack.findString(), or in the assumption that > > the first being true implies the second will always produce a valid > > result. Is it true that if it has a value that value must be > > extractable as a string? The freemarker docs suggest that maybe > > ?has_content would be better than ?exists ... > > This rational is almost right, but has a big hole. We're asking whether > the tag has a parameter set, and then assuming the data has not null for > that attribute. I indeed had a piece of data with null for that value, > which caused my problem. Since that attribute was derived, I was able > to modify my model object to return "" in that case instead of null, and > I'm golden. I might suggest this alteration to the .ftl file, though: > > <#if parameters.doubleListValue?exists><#t/> > + <#if > stack.findString(parameters.doubleListValue)?has_content><#t/> > <#assign doubleItemValue = > stack.findString(parameters.doubleListValue) /><#t/> > + <#t/> > <#else><#t/> > <#assign doubleItemValue = stack.findString('top') /><#t/> > <#t/> > > Now I don't have to change interfaces for large groups! Yay! Thanks! > > -Dale > > P.S.: I shoulda known that 1124 was not a magic enough number to be a > systemic problem--that number should have led me to look at my data > sooner :-/. > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts][2.0.11] optiontransferselect limit?
good call dale! http://freemarker.org/docs/ref_builtins_expert.html implementing has_content will definitely detect no content condition without consulting gray's anatomy for 'systemic' I cant say if this is related to 'aortic' maladies rather than pulmonary? but thats a topic for another day.. Thanks Martin-- - Original Message - From: "Dale Newfield" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Saturday, December 15, 2007 11:12 PM Subject: Re: [struts][2.0.11] optiontransferselect limit? > Dale Newfield wrote: > > Martin Gainty wrote: > >> this is the applicable code in my copy of optiontransferselect.ftl > > Thanks for making me look at this--it led me straight to my problem! > > > So we know there is a problem with the freemarker libraries, and that > > it's either in ?exists, or stack.findString(), or in the assumption that > > the first being true implies the second will always produce a valid > > result. Is it true that if it has a value that value must be > > extractable as a string? The freemarker docs suggest that maybe > > ?has_content would be better than ?exists ... > > This rational is almost right, but has a big hole. We're asking whether > the tag has a parameter set, and then assuming the data has not null for > that attribute. I indeed had a piece of data with null for that value, > which caused my problem. Since that attribute was derived, I was able > to modify my model object to return "" in that case instead of null, and > I'm golden. I might suggest this alteration to the .ftl file, though: > > <#if parameters.doubleListValue?exists><#t/> > + <#if > stack.findString(parameters.doubleListValue)?has_content><#t/> > <#assign doubleItemValue = > stack.findString(parameters.doubleListValue) /><#t/> > + <#t/> > <#else><#t/> > <#assign doubleItemValue = stack.findString('top') /><#t/> > <#t/> > > Now I don't have to change interfaces for large groups! Yay! Thanks! > > -Dale > > P.S.: I shoulda known that 1124 was not a magic enough number to be a > systemic problem--that number should have led me to look at my data > sooner :-/. > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts][2.0.11] optiontransferselect limit?
Dale Newfield wrote: Martin Gainty wrote: this is the applicable code in my copy of optiontransferselect.ftl Thanks for making me look at this--it led me straight to my problem! So we know there is a problem with the freemarker libraries, and that it's either in ?exists, or stack.findString(), or in the assumption that the first being true implies the second will always produce a valid result. Is it true that if it has a value that value must be extractable as a string? The freemarker docs suggest that maybe ?has_content would be better than ?exists ... This rational is almost right, but has a big hole. We're asking whether the tag has a parameter set, and then assuming the data has not null for that attribute. I indeed had a piece of data with null for that value, which caused my problem. Since that attribute was derived, I was able to modify my model object to return "" in that case instead of null, and I'm golden. I might suggest this alteration to the .ftl file, though: <#if parameters.doubleListValue?exists><#t/> + <#if stack.findString(parameters.doubleListValue)?has_content><#t/> <#assign doubleItemValue = stack.findString(parameters.doubleListValue) /><#t/> + <#t/> <#else><#t/> <#assign doubleItemValue = stack.findString('top') /><#t/> <#t/> Now I don't have to change interfaces for large groups! Yay! Thanks! -Dale P.S.: I shoulda known that 1124 was not a magic enough number to be a systemic problem--that number should have led me to look at my data sooner :-/. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts][2.0.11] optiontransferselect limit?
Martin Gainty wrote: this is the applicable code in my copy of optiontransferselect.ftl <#if parameters.doubleListValue?exists><#t/> <#assign doubleItemValue = stack.findString(parameters.doubleListValue) /><#t/> <#else><#t/> <#assign doubleItemValue = stack.findString('top') /><#t/> <#t/> so..supposedly the parameters.doubleListValue has to exist before stack.findString uses it D'oh! Yes, this is what mine has, I just hadn't gotten around to looking at it, yet :-) What are all those <#t/> tags for? So we know there is a problem with the freemarker libraries, and that it's either in ?exists, or stack.findString(), or in the assumption that the first being true implies the second will always produce a valid result. Is it true that if it has a value that value must be extractable as a string? The freemarker docs suggest that maybe ?has_content would be better than ?exists ... I didn't realize just how long that stack trace was--sorry for including it all :-) -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts][2.0.11] optiontransferselect limit?
Hi Dale this is the applicable code in my copy of optiontransferselect.ftl <#if parameters.doubleListValue?exists><#t/> <#assign doubleItemValue = stack.findString(parameters.doubleListValue) /><#t/> <#else><#t/> <#assign doubleItemValue = stack.findString('top') /><#t/> <#t/> so..supposedly the parameters.doubleListValue has to exist before stack.findString uses it is this what you have? M-- - Original Message - From: "Dale Newfield" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Saturday, December 15, 2007 6:36 PM Subject: Re: [struts][2.0.11] optiontransferselect limit? > Martin Gainty wrote: > > second time Ive seen error 'cannot locate findString' > > It's not that it can't find findString, it's that the string being found > is not there, so findString() returns an undefined value that cannot > then be assigned to a variable. > > Error on line 264, column 13 in template/simple/optiontransferselect.ftl > stack.findString(parameters.doubleListValue) is undefined. > It cannot be assigned to doubleItemValue > The problematic instruction: > -- > ==> assignment: > doubleItemValue=stack.findString(parameters.doubleListValue) [on line > 264, column 13 in template/simple/optiontransferselect.ftl] > in user-directive s.iterator [on line 256, column 9 in > template/simple/optiontransferselect.ftl] > in include > "/${parameters.templateDir}/simple/optiontransferselect.ftl" [on line > 24, column 1 in template/xhtml/optiontransferselect.ftl] > -- > > Java backtrace for programmers: > -- > freemarker.core.InvalidReferenceException: Error on line 264, column 13 > in template/simple/optiontransferselect.ftl > stack.findString(parameters.doubleListValue) is undefined. > It cannot be assigned to doubleItemValue > at freemarker.core.Assignment.accept(Assignment.java:111) > at freemarker.core.Environment.visit(Environment.java:196) > at freemarker.core.IfBlock.accept(IfBlock.java:82) > at freemarker.core.Environment.visit(Environment.java:196) > at freemarker.core.MixedContent.accept(MixedContent.java:92) > at freemarker.core.Environment.visit(Environment.java:196) > at freemarker.core.Environment.visit(Environment.java:233) > at freemarker.core.UnifiedCall.accept(UnifiedCall.java:116) > at freemarker.core.Environment.visit(Environment.java:196) > at freemarker.core.MixedContent.accept(MixedContent.java:92) > at freemarker.core.Environment.visit(Environment.java:196) > at freemarker.core.Environment.include(Environment.java:1375) > at freemarker.core.Include.accept(Include.java:155) > at freemarker.core.Environment.visit(Environment.java:196) > at freemarker.core.MixedContent.accept(MixedContent.java:92) > at freemarker.core.Environment.visit(Environment.java:196) > at freemarker.core.Environment.process(Environment.java:176) > at freemarker.template.Template.process(Template.java:232) > at > org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTempla te(FreemarkerTemplateEngine.java:168) > at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:530) > at org.apache.struts2.components.UIBean.end(UIBean.java:484) > at > org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSuppor t.java:43) > at > org.apache.jsp.WEB_002dINF.pages.communityForm_jsp._jspx_meth_s_005foptiontr ansferselect_005f0(communityForm_jsp.java:931) > at > org.apache.jsp.WEB_002dINF.pages.communityForm_jsp._jspx_meth_s_005fform_005 f0(communityForm_jsp.java:403) > at > org.apache.jsp.WEB_002dINF.pages.communityForm_jsp.access$0(communityForm_js p.java:286) > at > org.apache.jsp.WEB_002dINF.pages.communityForm_jsp$communityForm_jspHelper.i nvoke0(communityForm_jsp.java:1034) > at > org.apache.jsp.WEB_002dINF.pages.communityForm_jsp$communityForm_jspHelper.i nvoke(communityForm_jsp.java:1056) > at org.apache.jsp.tag.web.module_tag.doTag(module_tag.java:49) > at > org.apache.jsp.WEB_002dINF.pages.communityForm_jsp._jspx_meth_seenaboutTags_ 005fmodule_005f0(communityForm_jsp.java:282) > at > org.apache.jsp.WEB_002dINF.pages.communityForm_jsp._jspService(communityForm _jsp.java:148) > at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > at > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 28) > at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315) > at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > at > org.apache.catalina.core.ApplicationFil
Re: [struts][2.0.11] optiontransferselect limit?
curity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:130) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:107) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:78) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:383) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685) at java.lang.Thread.run(Thread.java:613) Thanks, M-- - Original Message - From: "Dale Newfield" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Saturday, December 15, 2007 2:05 PM Subject: Re: [struts][2.0.11] optiontransferselect limit? Dale Newfield wrote: I've got a page that uses s:optiontransferselect, and I'm pretty happy with it, but I'm now trying to scale up this app, and just over 1000 entries and the freemarker template bombs out: I've got a different solution in mind that should work when this gets large. freemarker.core.InvalidReferenceException: Error on line 264, column 13 in template/simple/optiontransferselect.ftl stack.findString(parameters.doubleListValue) is undefined. It cannot be assigned to doubleItemValue I just realized that they problem is probably not with freemarker--I bet this is the right error message, as when the collection gets big I bet one is being added that is not correctly initialized and the appropriate field is indeed not there. I think the freemarker core should be configurable so that it can log the error and move on rather than fail the way it is. Tomorrow I'll try the latest freemarker, and if necessary go file a ticket with them (w/patches if they're lucky :-) . Alternately I might have to alter the struts2 freemarker template to catch the exception and log it and move on, or failing that in my code I could call the s:optiontransferselect tag inside a try/catch block and do it myself. Time will tell. The actual number is confusing: It works with 1125 total in list2 (with 2 selected and instead in list1), but with 1126 possible values it crashes. Usually the size at which something breaks is indicative, but the only thing I can think of is 1126 -2 (selected) = 1024 + 100 ? I confirmed the way this is working, and yes, the magic number is it breaks at 1124. I've got two possibilities: Either HashSet is failing in some way, or more likely the lazy loaded hibernate collection used to fill that HashSet is doing something wonky when it gets that big. I'd bet the latter. -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ---
Re: [struts][2.0.11] optiontransferselect limit?
Hi Folks- second time Ive seen error 'cannot locate findString' https://issues.apache.org/struts/browse/WW-2373 Can we some info from dev group on the location of stack.findString(parameters.doubleListValue) ? Thanks, M-- - Original Message - From: "Dale Newfield" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Saturday, December 15, 2007 2:05 PM Subject: Re: [struts][2.0.11] optiontransferselect limit? > Dale Newfield wrote: > > I've got a page that uses s:optiontransferselect, and I'm pretty happy > > with it, but I'm now trying to scale up this app, and just over 1000 > > entries and the freemarker template bombs out: > > I've got a different solution in mind that should work when this gets large. > > > freemarker.core.InvalidReferenceException: Error on line 264, column 13 > > in template/simple/optiontransferselect.ftl > > stack.findString(parameters.doubleListValue) is undefined. > > It cannot be assigned to doubleItemValue > > I just realized that they problem is probably not with freemarker--I bet > this is the right error message, as when the collection gets big I bet > one is being added that is not correctly initialized and the appropriate > field is indeed not there. I think the freemarker core should be > configurable so that it can log the error and move on rather than fail > the way it is. Tomorrow I'll try the latest freemarker, and if > necessary go file a ticket with them (w/patches if they're lucky :-) . > Alternately I might have to alter the struts2 freemarker template to > catch the exception and log it and move on, or failing that in my code I > could call the s:optiontransferselect tag inside a try/catch block and > do it myself. Time will tell. > > > The actual number is confusing: It works with 1125 total in list2 (with > > 2 selected and instead in list1), but with 1126 possible values it > > crashes. Usually the size at which something breaks is indicative, but > > the only thing I can think of is 1126 -2 (selected) = 1024 + 100 ? > > I confirmed the way this is working, and yes, the magic number is it > breaks at 1124. I've got two possibilities: Either HashSet is failing > in some way, or more likely the lazy loaded hibernate collection used to > fill that HashSet is doing something wonky when it gets that big. I'd > bet the latter. > > -Dale > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts][2.0.11] optiontransferselect limit?
Dale Newfield wrote: I've got a page that uses s:optiontransferselect, and I'm pretty happy with it, but I'm now trying to scale up this app, and just over 1000 entries and the freemarker template bombs out: I've got a different solution in mind that should work when this gets large. freemarker.core.InvalidReferenceException: Error on line 264, column 13 in template/simple/optiontransferselect.ftl stack.findString(parameters.doubleListValue) is undefined. It cannot be assigned to doubleItemValue I just realized that they problem is probably not with freemarker--I bet this is the right error message, as when the collection gets big I bet one is being added that is not correctly initialized and the appropriate field is indeed not there. I think the freemarker core should be configurable so that it can log the error and move on rather than fail the way it is. Tomorrow I'll try the latest freemarker, and if necessary go file a ticket with them (w/patches if they're lucky :-) . Alternately I might have to alter the struts2 freemarker template to catch the exception and log it and move on, or failing that in my code I could call the s:optiontransferselect tag inside a try/catch block and do it myself. Time will tell. The actual number is confusing: It works with 1125 total in list2 (with 2 selected and instead in list1), but with 1126 possible values it crashes. Usually the size at which something breaks is indicative, but the only thing I can think of is 1126 -2 (selected) = 1024 + 100 ? I confirmed the way this is working, and yes, the magic number is it breaks at 1124. I've got two possibilities: Either HashSet is failing in some way, or more likely the lazy loaded hibernate collection used to fill that HashSet is doing something wonky when it gets that big. I'd bet the latter. -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]