You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Struts2 Fan <st...@gmail.com> on 2007/02/02 18:29:34 UTC

How to create a using the struts.properties file

Hi I want to use the <s:select> using the struts.properties file

struts.properties file
country.values = Italy,Holland
country.keys = 1,2

-----------------------------------
<s:select listKey="country.keys" listValue="country.values">

but <s:select> requires list attribute. How can I solve this problem?

Thanks...

Re: How to create a using the struts.properties file

Posted by Struts2 Fan <st...@gmail.com>.
Sorry but I think I could not explain what I want
I want to create a <s:select> using a key and a value List which will be get
from struts.properties file.

If you can give me a sample of struts.properties file (how to write the
values and keys on this file) and <s:select> example, I would appreciate.

Thanks for your help...

Re: How to create a using the struts.properties file

Posted by Don Brown <do...@gmail.com>.
Oh, try this:

<s:select list="city" theme="simple" />

The problem is your empty list attribute.  Just give it the map and it
should know what to do.

Don

On 2/2/07, Struts2 Fan <st...@gmail.com> wrote:
> ERROR [jsp]: Servlet.service() for servlet jsp threw exception
> tag 'select', field 'list': The requested list key '' could not be resolved
> as a collection/array/map/enumeration/iterator type. Example: people or
> people.{name} - [unknown location]
>     at org.apache.struts2.components.Component.fieldError(Component.java
> :221)
>     at org.apache.struts2.components.Component.findValue(Component.java:283)
> ----------------------------------------------------------------------------
>
> <s:select list="" listKey="city.keys" listValue="city.values"
> theme="simple"/>
>
> I don't know what to write to "list" attribute it is required but I want to
> use the value in struts.properties file as I said on the first message.
>
>

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


Re: How to create a using the struts.properties file

Posted by Struts2 Fan <st...@gmail.com>.
ERROR [jsp]: Servlet.service() for servlet jsp threw exception
tag 'select', field 'list': The requested list key '' could not be resolved
as a collection/array/map/enumeration/iterator type. Example: people or
people.{name} - [unknown location]
    at org.apache.struts2.components.Component.fieldError(Component.java
:221)
    at org.apache.struts2.components.Component.findValue(Component.java:283)
----------------------------------------------------------------------------

<s:select list="" listKey="city.keys" listValue="city.values"
theme="simple"/>

I don't know what to write to "list" attribute it is required but I want to
use the value in struts.properties file as I said on the first message.

Re: How to create a using the struts.properties file

Posted by Don Brown <do...@gmail.com>.
The select tag works with a map as well, which the Properties class
implements.  What error are you seeing?

Don

On 2/2/07, Struts2 Fan <st...@gmail.com> wrote:
> Hi I want to use the <s:select> using the struts.properties file
>
> struts.properties file
> country.values = Italy,Holland
> country.keys = 1,2
>
> -----------------------------------
> <s:select listKey="country.keys" listValue="country.values">
>
> but <s:select> requires list attribute. How can I solve this problem?
>
> Thanks...
>
>

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