You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Yanto <ya...@gmail.com> on 2009/06/18 06:56:15 UTC

drop down list not working after using validation.xml

Hi,

We noted following error message in the screen after used the validation xml
file.

*org.apache.jasper.JasperException: tag 'select', field 'list', name
'entityInternalId': The requested list key 'entities' could not be resolved
as a collection/array/map/enumeration/iterator type. Example: people or
people.{name} - [unknown location]*

 without validation xml and application page showing dropdown coming
properly.
Jsp page

  <td class=*"cellText"* width=*""*>

                  <s:select   id=*"entityInternalId"*

                        name=*"entityInternalId"*

                        list=*"entities"*

                        headerKey=*""*

                        headerValue=*""*

                        listKey=*"internalId"*

                        listValue=*"entityName"*

                                     />

                                    </td>



Validation.xml



validators>

     <field name=*"entityInternalId"*>

        <field-validator type=*"requiredstring"*>

            <message>Please select the entity</message>

        </field-validator>

    </field>



     <field name=*"userId"*>

        <field-validator type=*"requiredstring"*>

            <message>Please *keyin* the *username*</message>

        </field-validator>

    </field>

    <field name=*"jsPassword"*>

        <field-validator type=*"requiredstring"*>

            <message>Please *keyin* the password</message>

        </field-validator>

    </field>

</validators>


Any one help on this ?

Regards
Yanto

Re: drop down list not working after using validation.xml

Posted by Yanto <ya...@gmail.com>.
Hi Dave,

>>Please consider copying your code snippets into a plain-text editor before
including them in an email message: we're getting a blank line between each
line >>and a lot of spurious asterisks.
 noted :)

Yes, we are loading the list with 10 values from database and struts
creating the instance per request ok.

Any problem in the above approach ?

Regards
Yanto


On Thu, Jun 18, 2009 at 7:38 PM, Dave Newton <ne...@yahoo.com> wrote:

> Please consider copying your code snippets into a plain-text editor before
> including them in an email message: we're getting a blank line between each
> line and a lot of spurious asterisks.
>
> Yanto wrote:
>
>> *org.apache.jasper.JasperException: tag 'select', field 'list', name
>> 'entityInternalId': The requested list key 'entities' could not be
>> resolved
>> as a collection/array/map/enumeration/iterator type. Example: people or
>> people.{name} - [unknown location]*
>>
>>  without validation xml and application page showing dropdown coming
>> properly.
>>
>>                  <s:select   id=*"entityInternalId"*
>>                        name=*"entityInternalId"*
>>                        list=*"entities"*
>>                        headerKey=*""*
>>                        headerValue=*""*
>>                        listKey=*"internalId"*
>>                        listValue=*"entityName"*
>>                                     />
>>
>> Any one help on this ?
>>
>
> Do you load the "entities" list? Recall that actions are instantiated
> per-request.
>
> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: drop down list not working after using validation.xml

Posted by Yanto <ya...@gmail.com>.
Hi,

After used prepare the method we could see the dropdown values. But
s:fielderror tag still displaying error messages even I selected the value
from the dropdown. So that its not invoking my action class. Because
assuming still one more selection not happened in the form. Why this
behavior ?  Any other way to handle this?

<validators>
    <field name="entityInternalId">   <!—list dropdown
        <field-validator type="requiredstring">
           <message>Please select the Entity</message>
        </field-validator>
    </field>
    <field name="userId">
        <field-validator type="requiredstring">
            <message key="form.login.userCode.required"/>
        </field-validator>
    </field>
    <field name="jsPassword">
        <field-validator type="requiredstring">
            <message key="form.login.password.required"/>
        </field-validator>
    </field>
</validators>

Regards
Yanto

On Fri, Jun 19, 2009 at 11:33 PM, Yanto <ya...@gmail.com> wrote:

> Hi Greg,
> thanks for the link...seem this faq entry explain the problem that we face
> now...will try it...
>
> Thanks
> Yanto
>
>
> On Fri, Jun 19, 2009 at 11:15 PM, Greg Lindholm <gr...@gmail.com>wrote:
>
>> Did you look at this FAQ entry?
>>
>>
>> http://struts.apache.org/2.1.6/docs/how-do-we-repopulate-controls-when-validation-fails.html
>>
>>
>> On Fri, Jun 19, 2009 at 10:43 AM, Girish Naik <gi...@gmail.com>
>> wrote:
>>
>> > One of my colleague had done it in some project. But dont know if its
>> the
>> > correct way. :(
>> >
>> >
>> > Regards,
>> > ---------------------------------------------------------
>> > Girish Naik
>> > Mobile:-+91-09740091638
>> > girish.naik@gmail.com
>> > Samuel Goldwyn<
>> > http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html>
>> > - "I'm willing to admit that I may not always be right, but I am never
>> > wrong."
>> >
>> > On Fri, Jun 19, 2009 at 5:24 PM, Yanto <ya...@gmail.com> wrote:
>> >
>> > > Hi Girish,
>> > >
>> > > Is this mean we can load the list again in Action's Preparable method
>> ?
>> > > currently, we are trying looking at the sample in internet.
>> > >
>> > > Thanks & Regards
>> > > Yanto
>> > >
>> > > On Thu, Jun 18, 2009 at 10:23 PM, Girish Naik <gi...@gmail.com>
>> > > wrote:
>> > >
>> > > > After validation, Action's Preparable method is called, you can load
>> > the
>> > > > required list in request again.
>> > > >
>> > > >
>> > > > Regards,
>> > > > ---------------------------------------------------------
>> > > > Girish Naik
>> > > > Mobile:-+91-09740091638
>> > > > girish.naik@gmail.com
>> > > > Samuel Goldwyn<
>> > > > http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html>
>> > > > - "I'm willing to admit that I may not always be right, but I am
>> never
>> > > > wrong."
>> > > >
>> > > > On Thu, Jun 18, 2009 at 5:08 PM, Dave Newton <newton.dave@yahoo.com
>> >
>> > > > wrote:
>> > > >
>> > > > > Please consider copying your code snippets into a plain-text
>> editor
>> > > > before
>> > > > > including them in an email message: we're getting a blank line
>> > between
>> > > > each
>> > > > > line and a lot of spurious asterisks.
>> > > > >
>> > > > > Yanto wrote:
>> > > > >
>> > > > >> *org.apache.jasper.JasperException: tag 'select', field 'list',
>> name
>> > > > >> 'entityInternalId': The requested list key 'entities' could not
>> be
>> > > > >> resolved
>> > > > >> as a collection/array/map/enumeration/iterator type. Example:
>> people
>> > > or
>> > > > >> people.{name} - [unknown location]*
>> > > > >>
>> > > > >>  without validation xml and application page showing dropdown
>> coming
>> > > > >> properly.
>> > > > >>
>> > > > >>                  <s:select   id=*"entityInternalId"*
>> > > > >>                        name=*"entityInternalId"*
>> > > > >>                        list=*"entities"*
>> > > > >>                        headerKey=*""*
>> > > > >>                        headerValue=*""*
>> > > > >>                        listKey=*"internalId"*
>> > > > >>                        listValue=*"entityName"*
>> > > > >>                                     />
>> > > > >>
>> > > > >> Any one help on this ?
>> > > > >>
>> > > > >
>> > > > > Do you load the "entities" list? Recall that actions are
>> instantiated
>> > > > > per-request.
>> > > > >
>> > > > > Dave
>> > > > >
>> > > > >
>> ---------------------------------------------------------------------
>> > > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > > > > For additional commands, e-mail: user-help@struts.apache.org
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>>
>
>

Re: drop down list not working after using validation.xml

Posted by Yanto <ya...@gmail.com>.
Hi Greg,
thanks for the link...seem this faq entry explain the problem that we face
now...will try it...

Thanks
Yanto

On Fri, Jun 19, 2009 at 11:15 PM, Greg Lindholm <gr...@gmail.com>wrote:

> Did you look at this FAQ entry?
>
>
> http://struts.apache.org/2.1.6/docs/how-do-we-repopulate-controls-when-validation-fails.html
>
>
> On Fri, Jun 19, 2009 at 10:43 AM, Girish Naik <gi...@gmail.com>
> wrote:
>
> > One of my colleague had done it in some project. But dont know if its the
> > correct way. :(
> >
> >
> > Regards,
> > ---------------------------------------------------------
> > Girish Naik
> > Mobile:-+91-09740091638
> > girish.naik@gmail.com
> > Samuel Goldwyn<
> > http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html>
> > - "I'm willing to admit that I may not always be right, but I am never
> > wrong."
> >
> > On Fri, Jun 19, 2009 at 5:24 PM, Yanto <ya...@gmail.com> wrote:
> >
> > > Hi Girish,
> > >
> > > Is this mean we can load the list again in Action's Preparable method ?
> > > currently, we are trying looking at the sample in internet.
> > >
> > > Thanks & Regards
> > > Yanto
> > >
> > > On Thu, Jun 18, 2009 at 10:23 PM, Girish Naik <gi...@gmail.com>
> > > wrote:
> > >
> > > > After validation, Action's Preparable method is called, you can load
> > the
> > > > required list in request again.
> > > >
> > > >
> > > > Regards,
> > > > ---------------------------------------------------------
> > > > Girish Naik
> > > > Mobile:-+91-09740091638
> > > > girish.naik@gmail.com
> > > > Samuel Goldwyn<
> > > > http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html>
> > > > - "I'm willing to admit that I may not always be right, but I am
> never
> > > > wrong."
> > > >
> > > > On Thu, Jun 18, 2009 at 5:08 PM, Dave Newton <ne...@yahoo.com>
> > > > wrote:
> > > >
> > > > > Please consider copying your code snippets into a plain-text editor
> > > > before
> > > > > including them in an email message: we're getting a blank line
> > between
> > > > each
> > > > > line and a lot of spurious asterisks.
> > > > >
> > > > > Yanto wrote:
> > > > >
> > > > >> *org.apache.jasper.JasperException: tag 'select', field 'list',
> name
> > > > >> 'entityInternalId': The requested list key 'entities' could not be
> > > > >> resolved
> > > > >> as a collection/array/map/enumeration/iterator type. Example:
> people
> > > or
> > > > >> people.{name} - [unknown location]*
> > > > >>
> > > > >>  without validation xml and application page showing dropdown
> coming
> > > > >> properly.
> > > > >>
> > > > >>                  <s:select   id=*"entityInternalId"*
> > > > >>                        name=*"entityInternalId"*
> > > > >>                        list=*"entities"*
> > > > >>                        headerKey=*""*
> > > > >>                        headerValue=*""*
> > > > >>                        listKey=*"internalId"*
> > > > >>                        listValue=*"entityName"*
> > > > >>                                     />
> > > > >>
> > > > >> Any one help on this ?
> > > > >>
> > > > >
> > > > > Do you load the "entities" list? Recall that actions are
> instantiated
> > > > > per-request.
> > > > >
> > > > > Dave
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > For additional commands, e-mail: user-help@struts.apache.org
> > > > >
> > > > >
> > > >
> > >
> >
>

Re: drop down list not working after using validation.xml

Posted by Greg Lindholm <gr...@gmail.com>.
Did you look at this FAQ entry?

http://struts.apache.org/2.1.6/docs/how-do-we-repopulate-controls-when-validation-fails.html


On Fri, Jun 19, 2009 at 10:43 AM, Girish Naik <gi...@gmail.com> wrote:

> One of my colleague had done it in some project. But dont know if its the
> correct way. :(
>
>
> Regards,
> ---------------------------------------------------------
> Girish Naik
> Mobile:-+91-09740091638
> girish.naik@gmail.com
> Samuel Goldwyn<
> http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html>
> - "I'm willing to admit that I may not always be right, but I am never
> wrong."
>
> On Fri, Jun 19, 2009 at 5:24 PM, Yanto <ya...@gmail.com> wrote:
>
> > Hi Girish,
> >
> > Is this mean we can load the list again in Action's Preparable method ?
> > currently, we are trying looking at the sample in internet.
> >
> > Thanks & Regards
> > Yanto
> >
> > On Thu, Jun 18, 2009 at 10:23 PM, Girish Naik <gi...@gmail.com>
> > wrote:
> >
> > > After validation, Action's Preparable method is called, you can load
> the
> > > required list in request again.
> > >
> > >
> > > Regards,
> > > ---------------------------------------------------------
> > > Girish Naik
> > > Mobile:-+91-09740091638
> > > girish.naik@gmail.com
> > > Samuel Goldwyn<
> > > http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html>
> > > - "I'm willing to admit that I may not always be right, but I am never
> > > wrong."
> > >
> > > On Thu, Jun 18, 2009 at 5:08 PM, Dave Newton <ne...@yahoo.com>
> > > wrote:
> > >
> > > > Please consider copying your code snippets into a plain-text editor
> > > before
> > > > including them in an email message: we're getting a blank line
> between
> > > each
> > > > line and a lot of spurious asterisks.
> > > >
> > > > Yanto wrote:
> > > >
> > > >> *org.apache.jasper.JasperException: tag 'select', field 'list', name
> > > >> 'entityInternalId': The requested list key 'entities' could not be
> > > >> resolved
> > > >> as a collection/array/map/enumeration/iterator type. Example: people
> > or
> > > >> people.{name} - [unknown location]*
> > > >>
> > > >>  without validation xml and application page showing dropdown coming
> > > >> properly.
> > > >>
> > > >>                  <s:select   id=*"entityInternalId"*
> > > >>                        name=*"entityInternalId"*
> > > >>                        list=*"entities"*
> > > >>                        headerKey=*""*
> > > >>                        headerValue=*""*
> > > >>                        listKey=*"internalId"*
> > > >>                        listValue=*"entityName"*
> > > >>                                     />
> > > >>
> > > >> Any one help on this ?
> > > >>
> > > >
> > > > Do you load the "entities" list? Recall that actions are instantiated
> > > > per-request.
> > > >
> > > > Dave
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: user-help@struts.apache.org
> > > >
> > > >
> > >
> >
>

Re: drop down list not working after using validation.xml

Posted by Girish Naik <gi...@gmail.com>.
One of my colleague had done it in some project. But dont know if its the
correct way. :(


Regards,
---------------------------------------------------------
Girish Naik
Mobile:-+91-09740091638
girish.naik@gmail.com
Samuel Goldwyn<http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html>
- "I'm willing to admit that I may not always be right, but I am never
wrong."

On Fri, Jun 19, 2009 at 5:24 PM, Yanto <ya...@gmail.com> wrote:

> Hi Girish,
>
> Is this mean we can load the list again in Action's Preparable method ?
> currently, we are trying looking at the sample in internet.
>
> Thanks & Regards
> Yanto
>
> On Thu, Jun 18, 2009 at 10:23 PM, Girish Naik <gi...@gmail.com>
> wrote:
>
> > After validation, Action's Preparable method is called, you can load the
> > required list in request again.
> >
> >
> > Regards,
> > ---------------------------------------------------------
> > Girish Naik
> > Mobile:-+91-09740091638
> > girish.naik@gmail.com
> > Samuel Goldwyn<
> > http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html>
> > - "I'm willing to admit that I may not always be right, but I am never
> > wrong."
> >
> > On Thu, Jun 18, 2009 at 5:08 PM, Dave Newton <ne...@yahoo.com>
> > wrote:
> >
> > > Please consider copying your code snippets into a plain-text editor
> > before
> > > including them in an email message: we're getting a blank line between
> > each
> > > line and a lot of spurious asterisks.
> > >
> > > Yanto wrote:
> > >
> > >> *org.apache.jasper.JasperException: tag 'select', field 'list', name
> > >> 'entityInternalId': The requested list key 'entities' could not be
> > >> resolved
> > >> as a collection/array/map/enumeration/iterator type. Example: people
> or
> > >> people.{name} - [unknown location]*
> > >>
> > >>  without validation xml and application page showing dropdown coming
> > >> properly.
> > >>
> > >>                  <s:select   id=*"entityInternalId"*
> > >>                        name=*"entityInternalId"*
> > >>                        list=*"entities"*
> > >>                        headerKey=*""*
> > >>                        headerValue=*""*
> > >>                        listKey=*"internalId"*
> > >>                        listValue=*"entityName"*
> > >>                                     />
> > >>
> > >> Any one help on this ?
> > >>
> > >
> > > Do you load the "entities" list? Recall that actions are instantiated
> > > per-request.
> > >
> > > Dave
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
>

Re: drop down list not working after using validation.xml

Posted by Yanto <ya...@gmail.com>.
Hi Girish,

Is this mean we can load the list again in Action's Preparable method ?
currently, we are trying looking at the sample in internet.

Thanks & Regards
Yanto

On Thu, Jun 18, 2009 at 10:23 PM, Girish Naik <gi...@gmail.com> wrote:

> After validation, Action's Preparable method is called, you can load the
> required list in request again.
>
>
> Regards,
> ---------------------------------------------------------
> Girish Naik
> Mobile:-+91-09740091638
> girish.naik@gmail.com
> Samuel Goldwyn<
> http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html>
> - "I'm willing to admit that I may not always be right, but I am never
> wrong."
>
> On Thu, Jun 18, 2009 at 5:08 PM, Dave Newton <ne...@yahoo.com>
> wrote:
>
> > Please consider copying your code snippets into a plain-text editor
> before
> > including them in an email message: we're getting a blank line between
> each
> > line and a lot of spurious asterisks.
> >
> > Yanto wrote:
> >
> >> *org.apache.jasper.JasperException: tag 'select', field 'list', name
> >> 'entityInternalId': The requested list key 'entities' could not be
> >> resolved
> >> as a collection/array/map/enumeration/iterator type. Example: people or
> >> people.{name} - [unknown location]*
> >>
> >>  without validation xml and application page showing dropdown coming
> >> properly.
> >>
> >>                  <s:select   id=*"entityInternalId"*
> >>                        name=*"entityInternalId"*
> >>                        list=*"entities"*
> >>                        headerKey=*""*
> >>                        headerValue=*""*
> >>                        listKey=*"internalId"*
> >>                        listValue=*"entityName"*
> >>                                     />
> >>
> >> Any one help on this ?
> >>
> >
> > Do you load the "entities" list? Recall that actions are instantiated
> > per-request.
> >
> > Dave
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>

Re: drop down list not working after using validation.xml

Posted by Girish Naik <gi...@gmail.com>.
After validation, Action's Preparable method is called, you can load the
required list in request again.


Regards,
---------------------------------------------------------
Girish Naik
Mobile:-+91-09740091638
girish.naik@gmail.com
Samuel Goldwyn<http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html>
- "I'm willing to admit that I may not always be right, but I am never
wrong."

On Thu, Jun 18, 2009 at 5:08 PM, Dave Newton <ne...@yahoo.com> wrote:

> Please consider copying your code snippets into a plain-text editor before
> including them in an email message: we're getting a blank line between each
> line and a lot of spurious asterisks.
>
> Yanto wrote:
>
>> *org.apache.jasper.JasperException: tag 'select', field 'list', name
>> 'entityInternalId': The requested list key 'entities' could not be
>> resolved
>> as a collection/array/map/enumeration/iterator type. Example: people or
>> people.{name} - [unknown location]*
>>
>>  without validation xml and application page showing dropdown coming
>> properly.
>>
>>                  <s:select   id=*"entityInternalId"*
>>                        name=*"entityInternalId"*
>>                        list=*"entities"*
>>                        headerKey=*""*
>>                        headerValue=*""*
>>                        listKey=*"internalId"*
>>                        listValue=*"entityName"*
>>                                     />
>>
>> Any one help on this ?
>>
>
> Do you load the "entities" list? Recall that actions are instantiated
> per-request.
>
> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: drop down list not working after using validation.xml

Posted by Dave Newton <ne...@yahoo.com>.
Please consider copying your code snippets into a plain-text editor 
before including them in an email message: we're getting a blank line 
between each line and a lot of spurious asterisks.

Yanto wrote:
> *org.apache.jasper.JasperException: tag 'select', field 'list', name
> 'entityInternalId': The requested list key 'entities' could not be resolved
> as a collection/array/map/enumeration/iterator type. Example: people or
> people.{name} - [unknown location]*
> 
>  without validation xml and application page showing dropdown coming
> properly.
> 
>                   <s:select   id=*"entityInternalId"*
>                         name=*"entityInternalId"*
>                         list=*"entities"*
>                         headerKey=*""*
>                         headerValue=*""*
>                         listKey=*"internalId"*
>                         listValue=*"entityName"*
>                                      />
> 
> Any one help on this ?

Do you load the "entities" list? Recall that actions are instantiated 
per-request.

Dave

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