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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:16:18+00:00 2026-05-24T09:16:18+00:00

I am working on a Spring 3 MVC application with form validation. The validation

  • 0

I am working on a Spring 3 MVC application with form validation. The validation is working on the server side but even though I am returning the BindingResult the tag doesn’t show a message when validation fails.

Controller Method:


  @RequestMapping(value = "server/{serverId}/save", method = RequestMethod.POST)
  public ModelAndView saveServer( @PathVariable long serverId,
                                  @Valid ServerEditor serverEditor, 
                                  BindingResult result){

        AdminSystemServer server = adminService.loadServer(serverId);
        if (!result.hasErrors()){
            server.setServerName(serverEditor.getServerName());
            server.setServerUrl(serverEditor.getServerUrl());
            adminService.save(server);
        }

        mv.setViewName(".layout.servers.manage.server");
        mv.addObject("server", server);
        mv.addObject("result", result);
        return mv;
    }

Form jsp

<form:form commandName="serverEditor" action="/admin/app/servers/manage/system/save">
<span class="tableRow">
    <label for="serverName">System Name</label>
    <form:input path="serverName" class="required" /><br />
</span>

<span class="tableRow">
    <form:errors cssClass="errors" path="serverName" />
    </span>

</form:form>

I know the validation is working, as I step through debug and see the errors in the binding result, but the messages never appear.

Anyone have any ideas?

  • 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-24T09:16:19+00:00Added an answer on May 24, 2026 at 9:16 am

    Turns out my problem, which someone asked about earlier but I didn’t think was connected, was having the ModelAndView declared on the class level. This prevents the bindingresult from being properly inserted into the model.

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

Sidebar

Related Questions

I'm working on a Java web application (Adobe Flex front-end, JPA/Hibernate/BlazeDS/Spring MVC backend) and
I am new to Spring MVC. But I had certain experience in working with
I am using Spring MVC for a web application and I am working with
I'm working on porting part of an existing Spring MVC application over to Wicket.
I'm working on converting an old Struts 1.x application to Spring MVC and in
I'm working on a reporting web application using JasperReport and Spring MVC 3 to
We are working on a Spring 3.0.5 Web MVC-based application. In our code we
I have a working Spring MVC application(doing everything I wanted when deployed to jboss)
I can't seem to get basic validation working with Spring MVC. I have the
I'm working on a Spring MVC 3 web application, I have some JSPs that

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.