Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4023980
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:39:55+00:00 2026-05-20T10:39:55+00:00

I’m trying to create a form which contains a radio button that maps to

  • 0

I’m trying to create a form which contains a radio button that maps to a class that extends java.lang.Enum.

<s:form action="corp_low_save">
  <s:textfield label="Corporate Client Name" name="name"/>
  <s:radio list="clientStatus.status" name="clientStatus.status"/>
  <s:textfield label="Primary Address Street" name="primaryAddress.street"/>  
  <s:submit />
</s:form>

The Action implements ModelDriven and is making a new instance of the following object available via getModel():

public class com...Customer extends java.lang.Object{
    protected java.lang.String name;
    protected com...ClientStatus clientStatus;
    protected com...Address primaryAddress;
    public com...Customer();
    public java.lang.String getName();
    public void setName(java.lang.String);
    public com...ClientStatus getClientStatus();
    public void setClientStatus(com...ClientStatus);
    public com...Address getPrimaryAddress();
    public void setPrimaryAddress(com...Address);
}

Here are the rest of the relevant classes. They were all generated by JAXB:

public class com...ClientStatus extends java.lang.Object{
    protected com...StatusString status;
    protected javax.xml.datatype.XMLGregorianCalendar since;
    protected java.lang.String business;
    public com...ClientStatus();
    public com...StatusString getStatus();
    public void setStatus(com...StatusString);
    public javax.xml.datatype.XMLGregorianCalendar getSince();
    public void setSince(javax.xml.datatype.XMLGregorianCalendar);
    public java.lang.String getBusiness();
    public void setBusiness(java.lang.String);
}

public final class com...StatusString extends java.lang.Enum{
    public static final com...StatusString NEW_CLIENT;
    public static final com...StatusString EXISTING_CLIENT;
    public static final com...StatusString RENEWAL;
    public static com...StatusString[] values();
    public static com...StatusString valueOf(java.lang.String);
    public java.lang.String value();
    public static com...StatusString fromValue(java.lang.String);
    static {};
}

I’m getting this error:

org.apache.jasper.JasperException: tag
‘radio’, field ‘list’, name
‘clientStatus.status’: The requested
list key ‘clientStatus.status’ could
not be resolved as a
collection/array/map/enumeration/iterator
type. Example: people or people.{name}

Any ideas about what the problem could be?

Edit:
I think the issue is that ClientStatus is null. Since I simply instantiated a new Customer() its fields are null. This is a bummer because it requires me to encode duplicate information in two parts of my program. I can do something like this in the view:

  <s:radio name="clientStatus.status"
       list="#{'NEW_CLIENT':'New Client',
               'EXISTING_CLIENT':'Existing Client',
               'RENEWAL':'Renewal'}"/>

Or, in the controller, I have to explicitly instantiate the fields of Customer that my view needs. This also dashes my hopes of writing a general action that can process all sorts of JAXB objects by simply instantiating a given JAXB class and making it available via getModel().

Anyone have any ideas of how to recover from this unfortunate state of affairs?

Edit 2: Fixed the first form to what I would expect to work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:39:55+00:00Added an answer on May 20, 2026 at 10:39 am

    Revised Answer

    When the error message states:

    could not be resolved as a collection/array/map/enumeration/iterator type

    It means a java.util.Enumeration, not an enum.

    With that said, you can still use an enum, you just need to pass an array or collection of the values you want available. For example, ClientStatus.values(), which returns an array.

    Just add a getter to your action called getClientStatuses that returns the array (or a collection) of all of the values.

    Original Answer

    The list attribute needs to take all of the enum values. In your first example, it doesn’t look like that is occurring. Instead, you are providing clientStatus. Isn’t that an individual enum value?

    In your revised example, you are giving the list attribute a map, so it is working.

    I usually expose the enum values in my action. e.g., getClientStatuses.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.