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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:04:18+00:00 2026-05-19T05:04:18+00:00

I have a Spring 3 MVC app sing Hibernate as ORM. All works fine.

  • 0

I have a Spring 3 MVC app sing Hibernate as ORM. All works fine. But a question:

I have a web interface to create new objects, say a new CUSTOMER. Each CUSTOMER has a STATUS. The STATUS-Table has predefined values. The CUSTOMER-Table has a status_id field to joind the information.

When displaying a list of CUSTOMERS, I can access the CUSTOMER.STATUS property and get the right object baed on the id.

BUT: How can I define a standard status for NEW CUSTOMERS? I have a web interface with a dropdown.

<form:select path="status">
<form:option value="0" label="- Please Select -" />
<form:options items="${customerStatuses}" itemValue="id" />
</form:select>

This always shows the “Please Select” text because it seems like the value is always 0??? How can I change this to my individually selected standard status?

  • 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-19T05:04:19+00:00Added an answer on May 19, 2026 at 5:04 am

    You controller needs to take care of this. I would do it like this:

    @RequestMapping(value = { "/new-customer-form" })
    public String showNewCustomerForm(ModelMap model) {
        Customer newCustomer = new Customer();
        newCustomer.setStatus(statusRepository.getDefaultStatus());
        model.addAttribute("customer", newCustomer);
        model.addAttribute("customerStatuses", statusRepository.getAllStatuses());
        return "customer-form";
    }
    

    As a matter of fact, the “- Please Select -” label will not show anymore because your status is always filled.

    (I hope I understood your question correctly this time.)

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

Sidebar

Related Questions

I have a spring web app that uses Hibernate and Velocity. It's an MVC
I am building a web app built on Spring MVC and Hibernate. I have
I have a Spring-MVC, Hibernate, (Postgres 9 db) Web app. An admin user can
I have a Spring MVC web app running on my server. Recently I wanted
I have Spring MVC App integrated with Hibernate. Everything was OK until I use
Spring MVC web app: I have a stack trace w/o line numbers (shown at
I have my web application written in Spring MVC. It is quite simple app
I have a bunch of Hibernate mapped objects in my Spring MVC app. Default
I have an application built on Spring MVC that uses Hibernate for all of
I have a Spring MVC based Web Application with Hibernate. Following is the directory

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.