Re: [Struts2] problem with tag
Thanks Dave, This issue has been resolved using Preparable/prepare() On Dec 15, 2007 8:18 PM, Dave Newton <[EMAIL PROTECTED]> wrote: > You don't say how you initially populate the select box. In any case, > unless > you're populating it via Preparable/prepare() or some other automatic way > or > if it's not in application or session scope it won't get automatically > re-populated when you re-visit the page. > > d. > > --- Raghuveer Rawat <[EMAIL PROTECTED]> wrote: > > > Hi, > > I have a getting problem in using s:select tag. Need some help if anyone > > used s:select before. > > This dropdown is populated dynamically. When form is loaded initially > > dropdown is getting populated perfectly. No issue here. > > But when we submit the form and some of the validations fail then page > is > > not getting displayed correctly. This is because dropdown values are not > > coming back after the form submit. Not sure what need to be done to > bring > > back this dropdown values. > > I can see below error in the log. > > > > Servlet.service() for servlet jsp threw exception > > tag 'select', field 'list', name 'user.country': The requested list key > > 'countryList' could not be resolved as a > > collection/array/map/enumeration/iterator type. Example: people or > > people.{name} - [unknown location] > > > > Here is my jsp code for this issue: > > > > > cssClass="textbox1" > > list="countryList" listKey="code" > > listValue="name" required="true" /> > > > > Pl. let me know if you need some more information. > > > > Thanks in advance. > > > > > - > 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: What's up with validationErrors?
There's a StrutsUtils.getValidationErrors JavaScript method that's used for VM/FTL templates somewhere in like static/utils.js, but... I didn't know you could access it like that, but I'd check that out first--it's one of the only places "validationErrors" shows up anywhere :/ Interestink. d. --- Gary Affonso <[EMAIL PROTECTED]> wrote: > I made the mistake of using the "validationErrors" map in my Freemarker > page... > >${(validationErrors["postalAddress.firstName"]) !} > > I did this reflexively without thinking and it worked. For awhile. > Then it broke. In very strange ways. > > The problem I'm having with it is that if I add a fieldError, by hand, > in my action right before returning success (which shows the form) I > don't see the fieldError in the validationErrors map. > > In other words this fails... > > In my actions execute() method: > >addFieldError("emailAddress", "temp"); >return Action.SUCCESS; > > In my view mapped to SUCCESS: > >${(validationErrors["emailAddress"]) !} > > I get nada. > > But in some instances I do get errors in the validationErrors map. For > example, if I add fieldErrors from within a validate() method on my > form-processing action and then preserve those errors across the > redirect (via the MessageStoreInterceptor) to my form-show action, > *some* (but not all) of the validation errors are shown. > > WTF?! > > Anybody know what the deal is with the validationErrors map? What is it > supposed to contain? When does it get updated/synchronized with > actionErrors and fieldErrors? > > I'll avoid it for now (and just use the fieldErrors map directly) but > now I'm curious what validationErrors is supposed to do. Is it vestigal? > > Thanks! > > - Gary > > - > 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: [Struts2] problem with tag
You don't say how you initially populate the select box. In any case, unless you're populating it via Preparable/prepare() or some other automatic way or if it's not in application or session scope it won't get automatically re-populated when you re-visit the page. d. --- Raghuveer Rawat <[EMAIL PROTECTED]> wrote: > Hi, > I have a getting problem in using s:select tag. Need some help if anyone > used s:select before. > This dropdown is populated dynamically. When form is loaded initially > dropdown is getting populated perfectly. No issue here. > But when we submit the form and some of the validations fail then page is > not getting displayed correctly. This is because dropdown values are not > coming back after the form submit. Not sure what need to be done to bring > back this dropdown values. > I can see below error in the log. > > Servlet.service() for servlet jsp threw exception > tag 'select', field 'list', name 'user.country': The requested list key > 'countryList' could not be resolved as a > collection/array/map/enumeration/iterator type. Example: people or > people.{name} - [unknown location] > > Here is my jsp code for this issue: > > cssClass="textbox1" > list="countryList" listKey="code" > listValue="name" required="true" /> > > Pl. let me know if you need some more information. > > Thanks in advance. > - 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.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:269) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:188) > at > org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.jav a:413) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:215) > at > or
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.renderTemplate(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(ComponentTagSupport.java:43) at org.apache.jsp.WEB_002dINF.pages.communityForm_jsp._jspx_meth_s_005foptiontransferselect_005f0(communityForm_jsp.java:931) at org.apache.jsp.WEB_002dINF.pages.communityForm_jsp._jspx_meth_s_005fform_005f0(communityForm_jsp.java:403) at org.apache.jsp.WEB_002dINF.pages.communityForm_jsp.access$0(communityForm_jsp.java:286) at org.apache.jsp.WEB_002dINF.pages.communityForm_jsp$communityForm_jspHelper.invoke0(communityForm_jsp.java:1034) at org.apache.jsp.WEB_002dINF.pages.communityForm_jsp$communityForm_jspHelper.invoke(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:328) 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.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:413) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:97) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTransla
Re: What's up with validationErrors?
Hi Gary- what happens when you try it thru JS ? var errorsObject = StrutsUtils.getValidationErrors(text); ? M-- - Original Message - From: "Gary Affonso" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Saturday, December 15, 2007 1:00 PM Subject: What's up with validationErrors? > I made the mistake of using the "validationErrors" map in my Freemarker > page... > >${(validationErrors["postalAddress.firstName"]) !} > > I did this reflexively without thinking and it worked. For awhile. > Then it broke. In very strange ways. > > The problem I'm having with it is that if I add a fieldError, by hand, > in my action right before returning success (which shows the form) I > don't see the fieldError in the validationErrors map. > > In other words this fails... > > In my actions execute() method: > >addFieldError("emailAddress", "temp"); >return Action.SUCCESS; > > In my view mapped to SUCCESS: > >${(validationErrors["emailAddress"]) !} > > I get nada. > > But in some instances I do get errors in the validationErrors map. For > example, if I add fieldErrors from within a validate() method on my > form-processing action and then preserve those errors across the > redirect (via the MessageStoreInterceptor) to my form-show action, > *some* (but not all) of the validation errors are shown. > > WTF?! > > Anybody know what the deal is with the validationErrors map? What is it > supposed to contain? When does it get updated/synchronized with > actionErrors and fieldErrors? > > I'll avoid it for now (and just use the fieldErrors map directly) but > now I'm curious what validationErrors is supposed to do. Is it vestigal? > > Thanks! > > - Gary > > - > 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]
Re: 2.0.11: s:autocompleter
I got it as well. Changing the "name" parameter to "keyName" works. Thanks, Rodrigo Pereira On Dec 15, 2007 3:03 PM, Rodrigo Pereira <[EMAIL PROTECTED]> wrote: > I got it. :) > All magic is behind freemaker. > > dropdown.jsp: > > <%@ page contentType="text/html;charset=UTF-8" language="java" %> > <%@ taglib prefix="s" uri="/struts-tags" %> > > > Dropdown - Example > > > > > > listValue="name" listKey="valueId" notifyTopics="/refresh" /> > > > > formId="selectForm" listenTopics="/refresh" /> > > > > > > > struts.xml > > > > method="upper"> > /dropdown.jsp > > > method="lower"> > /options.ftl > > > > > > options.ftl > > [ > <#list lower as option> > ["${option.name}", "${option.valueId}"], > > ] > > DropdownAction: > > public class DropdownAction extends ActionSupport{ > > List upper = new ArrayList(); > List lower = new ArrayList(); > > private String upperValue; > private String lowerValue; > > > public String doUpper(){ > > upper.add( new Value(1,"A") ); > upper.add( new Value(2,"B") ); > > return SUCCESS; > } > > public String doLower(){ > > lower = new ArrayList(); > > if( upperValue.equalsIgnoreCase("A") ){ > lower.add( new Value(1,"a1") ); > lower.add( new Value(2,"a2") ); > }else{ > lower.add( new Value(1,"b1") ); > lower.add( new Value(2,"b2") ); > } > > return SUCCESS; > } > > // geters and seters > } > > Now I'd like to pass forward to my action list key value instead of list > value. > > Thanks, > Rodrigo Pereira > > > On Dec 15, 2007 2:32 PM, Martin Gainty <[EMAIL PROTECTED]> wrote: > > Rodrigo- > > > > There is a bug I logged on autocompleter..hopefully we'll have a patch soon > > https://issues.apache.org/struts/browse/WW-2373 > > Since you and I are the only folks following this do you want to take a > > quick glance at this? > > > > Saludos desde EEUU > > Martin- > > > > - Original Message - > > From: "Rodrigo Pereira" <[EMAIL PROTECTED]> > > To: "Struts Users Mailing List" > > Sent: Saturday, December 15, 2007 10:34 AM > > Subject: Re: 2.0.11: s:autocompleter > > > > > > > Hi, > > > does anybody have an example of s:autocompleter getting list value > > > from an action? > > > I have been trying to update a list based on the selection of another > > > one, but no success. I'd like the dropdown lists not hardcoded as > > > showcase example does. > > > > > > Thanks, > > > Rodrigo Pereira > > > > > > > > > On Dec 11, 2007 4:50 PM, Rodrigo Pereira <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I tried that but it only loads 1st dropdown, the 2nd is never updated. > > > > > > > > > > > > > > > > > > > listValue="name" listKey="valueId" notifyTopics="/changeLower"/> > > > > > > > > > > > > > > > > > > > listValue="name" listKey="valueId" listenTopics="/changeLower" > > > > formId="selectForm"/> > > > > > > > > > > > > Thanks, > > > > Rodrigo Pereira > > > > > > > > > > > > On Dec 11, 2007 4:42 PM, Dave Newton <[EMAIL PROTECTED]> wrote: > > > > > --- Rodrigo Pereira <[EMAIL PROTECTED]> wrote: > > > > > > this way you're hard coding the 1st dropdown list. > > > > > > I'd like to get it from an action. > > > > > > > > > > So use a value from the action instead of an immediate OGNL value. > > > > > > > > > > > By the way, how does the 2nd dropdown get updated? > > > > > > > > > > Via the notify/listen topics. > > > > > > > > > > d. > > > > > > > > > > > > > > > > > > > > - > > > > > 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] > > > > > > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
What's up with validationErrors?
I made the mistake of using the "validationErrors" map in my Freemarker page... ${(validationErrors["postalAddress.firstName"]) !} I did this reflexively without thinking and it worked. For awhile. Then it broke. In very strange ways. The problem I'm having with it is that if I add a fieldError, by hand, in my action right before returning success (which shows the form) I don't see the fieldError in the validationErrors map. In other words this fails... In my actions execute() method: addFieldError("emailAddress", "temp"); return Action.SUCCESS; In my view mapped to SUCCESS: ${(validationErrors["emailAddress"]) !} I get nada. But in some instances I do get errors in the validationErrors map. For example, if I add fieldErrors from within a validate() method on my form-processing action and then preserve those errors across the redirect (via the MessageStoreInterceptor) to my form-show action, *some* (but not all) of the validation errors are shown. WTF?! Anybody know what the deal is with the validationErrors map? What is it supposed to contain? When does it get updated/synchronized with actionErrors and fieldErrors? I'll avoid it for now (and just use the fieldErrors map directly) but now I'm curious what validationErrors is supposed to do. Is it vestigal? Thanks! - Gary - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 2.0.11: s:autocompleter
I got it. :) All magic is behind freemaker. dropdown.jsp: <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="s" uri="/struts-tags" %> Dropdown - Example struts.xml /dropdown.jsp /options.ftl options.ftl [ <#list lower as option> ["${option.name}", "${option.valueId}"], ] DropdownAction: public class DropdownAction extends ActionSupport{ List upper = new ArrayList(); List lower = new ArrayList(); private String upperValue; private String lowerValue; public String doUpper(){ upper.add( new Value(1,"A") ); upper.add( new Value(2,"B") ); return SUCCESS; } public String doLower(){ lower = new ArrayList(); if( upperValue.equalsIgnoreCase("A") ){ lower.add( new Value(1,"a1") ); lower.add( new Value(2,"a2") ); }else{ lower.add( new Value(1,"b1") ); lower.add( new Value(2,"b2") ); } return SUCCESS; } // geters and seters } Now I'd like to pass forward to my action list key value instead of list value. Thanks, Rodrigo Pereira On Dec 15, 2007 2:32 PM, Martin Gainty <[EMAIL PROTECTED]> wrote: > Rodrigo- > > There is a bug I logged on autocompleter..hopefully we'll have a patch soon > https://issues.apache.org/struts/browse/WW-2373 > Since you and I are the only folks following this do you want to take a > quick glance at this? > > Saludos desde EEUU > Martin- > > - Original Message - > From: "Rodrigo Pereira" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" > Sent: Saturday, December 15, 2007 10:34 AM > Subject: Re: 2.0.11: s:autocompleter > > > > Hi, > > does anybody have an example of s:autocompleter getting list value > > from an action? > > I have been trying to update a list based on the selection of another > > one, but no success. I'd like the dropdown lists not hardcoded as > > showcase example does. > > > > Thanks, > > Rodrigo Pereira > > > > > > On Dec 11, 2007 4:50 PM, Rodrigo Pereira <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I tried that but it only loads 1st dropdown, the 2nd is never updated. > > > > > > > > > > > > > > listValue="name" listKey="valueId" notifyTopics="/changeLower"/> > > > > > > > > > > > > > > listValue="name" listKey="valueId" listenTopics="/changeLower" > > > formId="selectForm"/> > > > > > > > > > Thanks, > > > Rodrigo Pereira > > > > > > > > > On Dec 11, 2007 4:42 PM, Dave Newton <[EMAIL PROTECTED]> wrote: > > > > --- Rodrigo Pereira <[EMAIL PROTECTED]> wrote: > > > > > this way you're hard coding the 1st dropdown list. > > > > > I'd like to get it from an action. > > > > > > > > So use a value from the action instead of an immediate OGNL value. > > > > > > > > > By the way, how does the 2nd dropdown get updated? > > > > > > > > Via the notify/listen topics. > > > > > > > > d. > > > > > > > > > > > > > > > > - > > > > 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] > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 + Sitemesh decorator mapping
Filipe- /* so unmapped index.jsp displays correctly (index.jsp is located in webapps/webAppName) panel.jsp and printable.jsp do not display as they are mapped constructs but using the defaultdir works /webapps/webAppName/decorators/panel.jsp works /webapps/webAppName/decorators/printable.jsp works Does this help? Martin-- - Original Message - From: "Filipe David Manana" <[EMAIL PROTECTED]> To: Sent: Friday, December 14, 2007 11:17 AM Subject: Struts 2 + Sitemesh decorator mapping > Hi, > > Anyone using Struts 2 with multiple Sitemesh decorators? > > I am trying to map a decorator to a specific subset of my webapp's URI > space. > > The structure of my src/main/webapp dir is: > > [EMAIL PROTECTED]:~/apache/struts/cdbweb2/src/main/webapp$ tree > . > |-- WEB-INF > | |-- decorators > | | `-- lsf.jsp > | |-- decorators.xml > | |-- dwr.xml > | |-- sitemesh.xml > | `-- web.xml > |-- img > | |-- logo.png > |-- index.html > |-- jsp > | |-- index.jsp > | `-- lsf > | `-- users > | |-- list.jsp > | `-- list.jsp~ > `-- styles > |-- main.css > `-- main.css~ > > I want to map URIs of the kind http://.../lsf/users/* to decorator lsf.jsp. > > the contents of my decorators.xml file: > > > > > > /nodecorate/* > /styles/* > /scripts/* > /images/* > /dojo/* > /struts/* > > > > /lsf/* > > > > I can't get this decorator used when I browse into > http://localhost:8080/cdbweb2/lsf/users/list.action > > I tried also with the patterns /lsf* , /lsf/users/* , /lsf/users/list.jsp , > etc and it doesn't work either. > Only works with the /* pattern. > Any suggestions? > > Thank you > > -- > Filipe David Manana, > [EMAIL PROTECTED] > > Obvious facts are like secrets to those not trained to see them. > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts] Struts 2 + Sitemesh decorator mapping
I fixed the problem: the pattern /*/lsf/* worked :) Thank you for replying. On Dec 14, 2007 9:23 PM, Dale Newfield <[EMAIL PROTECTED]> wrote: > Filipe David Manana wrote: > > Anyone using Struts 2 with multiple Sitemesh decorators? > > Yep. > > You mention using more than one decorator, but the decorators.xml file > you show only has one. It's scanned in order, and the first matching > one is used. Do you have your "other" decorator (with "/*") listed > before this one? > > -Dale > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Filipe David Manana, [EMAIL PROTECTED] Obvious facts are like secrets to those not trained to see them.
Re: 2.0.11: s:autocompleter
Hi, does anybody have an example of s:autocompleter getting list value from an action? I have been trying to update a list based on the selection of another one, but no success. I'd like the dropdown lists not hardcoded as showcase example does. Thanks, Rodrigo Pereira On Dec 11, 2007 4:50 PM, Rodrigo Pereira <[EMAIL PROTECTED]> wrote: > Hi, > I tried that but it only loads 1st dropdown, the 2nd is never updated. > > > > listValue="name" listKey="valueId" notifyTopics="/changeLower"/> > > > > listValue="name" listKey="valueId" listenTopics="/changeLower" > formId="selectForm"/> > > > Thanks, > Rodrigo Pereira > > > On Dec 11, 2007 4:42 PM, Dave Newton <[EMAIL PROTECTED]> wrote: > > --- Rodrigo Pereira <[EMAIL PROTECTED]> wrote: > > > this way you're hard coding the 1st dropdown list. > > > I'd like to get it from an action. > > > > So use a value from the action instead of an immediate OGNL value. > > > > > By the way, how does the 2nd dropdown get updated? > > > > Via the notify/listen topics. > > > > d. > > > > > > > > - > > 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]
Image Upload and Dojo
Hi, i try to submit a multipart/form-data with dojo, but it don't invoke any action. When I try it without dojo it works fine. My Code: <%@ taglib prefix="sx" uri="/struts-dojo-tags" %> . . . . . . Struts Version is 2.1.0 Does anyone have an Idea to solve my problem? -- View this message in context: http://www.nabble.com/Image-Upload-and-Dojo-tp14350527p14350527.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]