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 48653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:18:49+00:00 2026-05-10T16:18:49+00:00

There is a select dropdown and I want to add "No selection" item to

  • 0

There is a select dropdown and I want to add "No selection" item to the list which should give me ‘null’ when submitted. I’m using SimpleFormController derived controller.

protected Map referenceData(HttpServletRequest httpServletRequest, Object o, Errors errors) throws Exception {     Map<String, Object> map = new HashMap<String, Object>();      map.put("countryList", Arrays.asList(Country.values()));      return map; } 

And the jspx part is

<form:select path="country" items="${countryList}" title="country"/> 

One possible solution seems to be in adding a null value to the beginning of the list and then using a custom PropertyEditor to display this ‘null’ as ‘No selection’. Is there a better solution?

@Edit: I have solved this with a custom validation annotation which checks if the selected value is "No Selection". Is there a more standard and easier solution?

  • 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. 2026-05-10T16:18:50+00:00Added an answer on May 10, 2026 at 4:18 pm

    One option:

    <form:select path='country' title='country' >      <form:option value=''>&nbsp;</form:option>      <form:options items='${countryList}' /> </form:select> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 65k
  • Answers 65k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer as brd664 says, what you are actually doing in Application.application.resultsGrid.dataProvider… May 11, 2026 at 11:10 am
  • added an answer You need to have access to an smtp server somewhere.… May 11, 2026 at 11:09 am
  • added an answer You shouldn't put the rm -rf {} in single quotes.… May 11, 2026 at 11:09 am

Related Questions

There is a select dropdown and I want to add "No selection" item to
is there a quick way to sort the items of a select element? Or
Is there a way to select a parent element based on the class of
Is there a way to select data where any one of multiple conditions occur
Is there a way to select designtime packages on a project bases? Packages are
Is there a way to select which TestMethods you want to execute in Visual
Suppose I have a SELECT statement that returns some set of results. Is there
Using jQuery, is there a way to select all tag that reference a specific
When in incremental search mode in Intellij IDEA, is there a way to select
Is there a way in MySQL to select rows which fall on a specific

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.