Hi Jim,

The following is my getter.     

/**
     * Gets the countryCodes
     * @return the countryCodes
     */
    public Collection<CountryCode> getCountries()
    {
        return i_countries;
    }

This loads perfectly the first time I enter the page. It is only after it is
submitted and fails validation does it not work.

My structure is the following: 

The first class that is loaded is PreRegisterAction.java which on success
uses the page Register.jsp. This part works fine.

Once Register.jsp is submitted, if it passes validation, it uses
RegisterAction.java, which goes to RegisterSuccess.jsp. This also works fine


The piece that does not work is when it fails validation and comes back to
the input page, which is register.jsp

thanks,

Sid Bhatia
"Try not. Do...  or do not. There is no try" -- Yoda
_________________________
_ mailto:sidharth.bhat...@gmail.com 


-----Original Message-----
From: Jim Kiley [mailto:jhki...@summa-tech.com] 
Sent: Thursday, February 19, 2009 12:26 PM
To: Struts Users Mailing List
Subject: Re: Errors repopulating the list after validation.

Is your getter named "getCountries()"?

On Thu, Feb 19, 2009 at 12:23 PM, Sidharth Bhatia <
sidharth.bhat...@gmail.com> wrote:

> Hi,
>
> Thanks for the suggestion, but this seems to have not solved the problem.
> What I have is below:
>
> private Collection<CountryCode> i_countries = new
ArrayList<CountryCode>();
>
> thanks,
>
> Sid Bhatia
> "Try not. Do...  or do not. There is no try" -- Yoda
> _________________________
> _ mailto:sidharth.bhat...@gmail.com
>
>
> -----Original Message-----
> From: sheva j [mailto:shee...@gmail.com]
> Sent: Wednesday, February 18, 2009 11:42 PM
> To: Struts Users Mailing List
> Subject: Re: Errors repopulating the list after validation.
>
> Hi,
> Declare like this in your action class,
>
> List<String> country = new ArrayList<String>();
>
> Hope this will solve your problem....
>
> -
> Sheeva
>
> On Thu, Feb 19, 2009 at 5:47 AM, Sidharth Bhatia <
> sidharth.bhat...@gmail.com
> > wrote:
>
> > Hi,
> >
> >
> >
> > I have form, and a list that is being populated with it. When I first
> enter
> > the action the list populates properly. But the second time, I get the
> > following error:
> >
> >
> >
> > tag 'select', field 'list', name 'country': The requested list key
> > 'countries' could not be resolved as a
> > collection/array/map/enumeration/iterator type. Example: people or
> > people.{name} - [unknown location]
> >
> >
> > org.apache.struts2.components.Component.fieldError(Component.java:230)
> >
> >
> > org.apache.struts2.components.Component.findValue(Component.java:351)
> >
> >
> >
> >
>
>
org.apache.struts2.components.ListUIBean.evaluateExtraParams(ListUIBean.java
> > :80)
> >
> >
> >
org.apache.struts2.components.Select.evaluateExtraParams(Select.java:105)
> >
> >
> org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:856)
> >
> >        org.apache.struts2.components.UIBean.end(UIBean.java:510)
> >
> >
> >
> >
>
>
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSuppor
> > t.java:42)
> >
> >
> >
> >
>
>
org.apache.jsp.register_jsp._jspx_meth_s_005fselect_005f0(register_jsp.java:
> > 537)
> >
> >
> >
> >
>
>
org.apache.jsp.register_jsp._jspx_meth_s_005fform_005f0(register_jsp.java:18
> > 0)
> >
> >        org.apache.jsp.register_jsp._jspService(register_jsp.java:81)
> >
> >
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> >
> >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> >
> >
> >
> >
>
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> > 74)
> >
> >
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
> >
> >        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
> >
> >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> >
> >
> >
> >
>
>
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:9
> > 68)
> >
> >
> >
> >
>
>
org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:640
> > )
> >
> >
> >
>
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:634)
> >
> >
> >
> >
>
>
org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestC
> > ontext.java:80)
> >
> >
> >
> >
>
>
org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequest
> > Context.java:73)
> >
> >
> >
> >
>
>
org.apache.tiles.context.TilesRequestContextWrapper.dispatch(TilesRequestCon
> > textWrapper.java:72)
> >
> >
> >
> >
>
>
org.apache.struts2.tiles.StrutsTilesRequestContext.dispatch(StrutsTilesReque
> > stContext.java:88)
> >
> >
> >
> >
>
>
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:28
> > 3)
> >
> >
> >
> >
>
>
org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.jav
> > a:140)
> >
> >
> >
> >
>
>
org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.jav
> > a:117)
> >
> >
> >
> >
>
>
org.apache.tiles.jsp.taglib.RenderTagSupport.execute(RenderTagSupport.java:1
> > 54)
> >
> >
> >
> >
>
>
org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(RoleSecurityTagS
> > upport.java:75)
> >
> >
> >
> >
>
>
org.apache.tiles.jsp.taglib.ContainerTagSupport.doEndTag(ContainerTagSupport
> > .java:80)
> >
> >
> >
> >
>
>
org.apache.jsp.layouts.base_jsp._jspx_meth_tiles_005finsertAttribute_005f2(b
> > ase_jsp.java:157)
> >
> >        org.apache.jsp.layouts.base_jsp._jspService(base_jsp.java:79)
> >
> >
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> >
> >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> >
> >
> >
> >
>
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> > 74)
> >
> >
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
> >
> >        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
> >
> >        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> >
> >
> >
> >
>
>
org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletT
> > ilesRequestContext.java:198)
> >
> >
> >
> >
>
>
org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(Servlet
> > TilesRequestContext.java:179)
> >
> >
> >
> >
>
>
org.apache.tiles.context.TilesRequestContextWrapper.dispatch(TilesRequestCon
> > textWrapper.java:72)
> >
> >
> >
> >
>
>
org.apache.struts2.tiles.StrutsTilesRequestContext.dispatch(StrutsTilesReque
> > stContext.java:88)
> >
> >
> >
> >
>
>
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:60
> > 6)
> >
> >
> >
> >
>
>
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:24
> > 6)
> >
> >
> >
> org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:105)
> >
> >
> >
> >
>
>
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSuppor
> > t.java:186)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionI
> > nvocation.java:361)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:265)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(Validati
> > onInterceptor.java:249)
> >
> >
> >
> >
>
>
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.do
> > Intercept(AnnotationValidationInterceptor.java:68)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method
> > FilterInterceptor.java:87)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(Con
> > versionErrorInterceptor.java:122)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(Parame
> > tersInterceptor.java:195)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method
> > FilterInterceptor.java:87)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(Parame
> > tersInterceptor.java:195)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method
> > FilterInterceptor.java:87)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(St
> > aticParametersInterceptor.java:148)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
>
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterce
> > ptor.java:93)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
>
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInt
> > erceptor.java:235)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDr
> > ivenInterceptor.java:89)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(S
> > copedModelDrivenInterceptor.java:128)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
>
org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(Prof
> > ilingActivationInterceptor.java:104)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
>
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(Debu
> > ggingInterceptor.java:267)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingIn
> > terceptor.java:126)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareIn
> > terceptor.java:138)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method
> > FilterInterceptor.java:87)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nIntercepto
> > r.java:148)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
>
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletCon
> > figInterceptor.java:164)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasIntercep
> > tor.java:128)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(Ex
> > ceptionMappingInterceptor.java:176)
> >
> >
> >
> >
>
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
> > on.java:236)
> >
> >
> >
> >
>
>
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
> >
> >
> >
>
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)
> >
> >
> >
> >
>
>
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.jav
> > a:395)
> >
> >
> >
> > It seems like the countries object has been poped off of the value stack
> > during the validation firing, any ideas how to fix this??
> >
> >
> >
> > The tag is as follows:
> >
> >
> >
> > <s:select id="registration_countryCode" name="country" multiple="false"
> > emptyOption="true" required="true"
> >
> >            list="countries" listKey="code" listValue="name"
> label="Country"
> > >
> >
> >
> >
> > thanks,
> >
> > Sid Bhatia
> > "Try not. Do...  or do not. There is no try" -- Yoda
> > _________________________
> > *  <mailto:sidharth.bha...@lehman.com> mailto:sidharth.bhat...@gmail.com
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to