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

  • Home
  • SEARCH
  • 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 7973225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:03:12+00:00 2026-06-04T08:03:12+00:00

I am trying to add some code to my Spring JSP to display a

  • 0

I am trying to add some code to my Spring JSP to display a list of boroughs if the user does not have one setup in the system.

Here is my JSP code:

<form:hidden path="borough" />
            <c:choose>
                <c:when test="${empty borough}">
                            <tr>
                            <td width="129"><span class="ast">*</span>Borough: </td>
                            <td width="361">
                                    <form:select path="borough">
                                          <form:option value="Staten Island">Staten Island</form:option>
                                          <form:option value="Queens">Queens</form:option>
                                          <form:option value="Brooklyn">Brooklyn</form:option>
                                          <form:option value="Bronx">Bronx</form:option>
                                          <form:option value="Manhattan">Manhattan</form:option>
                                    </form:select>              
                            </td>
                        </tr>
                </c:when>
                <c:otherwise>
                        <form:hidden path="borough" />
                </c:otherwise>
            </c:choose>

The hidden field before the c:choose is for debugging only. Here is my output:

<input id="borough" name="borough" type="hidden" value="Queens"/>



                            <tr>
                            <td width="129"><span class="ast">*</span>Borough: </td>
                            <td width="361">
                                    <select id="borough" name="borough">
                                          <option value="Staten Island">Staten Island</option>
                                          <option value="Queens" selected="selected">Queens</option>
                                          <option value="Brooklyn">Brooklyn</option>

                                          <option value="Bronx">Bronx</option>
                                          <option value="Manhattan">Manhattan</option>
                                    </select>               
                            </td>
                        </tr>

So it looks like it thinks borough is always emply?

  • 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-06-04T08:03:13+00:00Added an answer on June 4, 2026 at 8:03 am

    What is the “commandName” attribute in your <form:form>? You will need to reference borough as a property of your command object. For example:

    <c:when test="${empty command.borough}">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm trying to add some ability to my project to allow user-defined properties
I have the next code to work on ASP.Net controls. I'm trying to add
I'm trying to add some songs to a vector inside a class. One of
I have the following code (attempting to log a user in programatically): List<GrantedAuthority> authorities
I'm trying to add some JQuery to an ASP.Net User Control to check to
I have some code that performs a deep copy using Object.clone, but I'm trying
I'm trying add some code at run time to the head element. When I
I'm trying to add some Hibernate functionality to a Spring web application. This is
I'm trying to add some contacts from an xml file which have been serialize
Im trying to add some short file names to a Wise installer to fix

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.